Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: increase archiver postgres shm size #4040

Merged
merged 2 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions archiver/archiver_isolation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ import (
"testing"
"time"

"github.com/rudderlabs/rudder-go-kit/bytesize"
"github.com/rudderlabs/rudder-go-kit/testhelper/docker/resource/postgres"
"github.com/rudderlabs/rudder-server/testhelper/destination"

"golang.org/x/sync/errgroup"

"github.com/google/uuid"
"github.com/ory/dockertest/v3"
"github.com/stretchr/testify/require"
"github.com/tidwall/gjson"
"golang.org/x/sync/errgroup"

"github.com/rudderlabs/rudder-go-kit/config"
"github.com/rudderlabs/rudder-go-kit/filemanager"
Expand Down Expand Up @@ -127,7 +130,7 @@ func ArchivalScenario(
cleanup := &testhelper.Cleanup{}
defer cleanup.Run()

postgresContainer, err := resource.SetupPostgres(pool, cleanup)
postgresContainer, err := resource.SetupPostgres(pool, cleanup, postgres.WithShmSize(256*bytesize.MB))
require.NoError(t, err, "failed to setup postgres container")

minioResource, err := resource.SetupMinio(pool, cleanup)
Expand Down
24 changes: 12 additions & 12 deletions archiver/archiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ import (
"github.com/stretchr/testify/require"
"github.com/tidwall/gjson"

"github.com/rudderlabs/rudder-go-kit/config"
"github.com/rudderlabs/rudder-go-kit/stats"

"github.com/rudderlabs/rudder-go-kit/bytesize"
"github.com/rudderlabs/rudder-go-kit/config"
"github.com/rudderlabs/rudder-go-kit/filemanager"
"github.com/rudderlabs/rudder-go-kit/stats"
"github.com/rudderlabs/rudder-go-kit/testhelper/docker/resource"
"github.com/rudderlabs/rudder-go-kit/testhelper/docker/resource/postgres"
trand "github.com/rudderlabs/rudder-go-kit/testhelper/rand"
backendconfig "github.com/rudderlabs/rudder-server/backend-config"
"github.com/rudderlabs/rudder-server/jobsdb"
Expand All @@ -47,7 +47,7 @@ func TestJobsArchival(t *testing.T) {
pool, err := dockertest.NewPool("")
require.NoError(t, err, "Failed to create docker pool")

postgresResource, err := resource.SetupPostgres(pool, t)
postgresResource, err := resource.SetupPostgres(pool, t, postgres.WithShmSize(256*bytesize.MB))
require.NoError(t, err, "failed to setup postgres resource")
c := config.New()
c.Set("DB.name", postgresResource.Database)
Expand Down Expand Up @@ -205,7 +205,7 @@ func readGzipJobFile(filename string) ([]*jobsdb.JobT, error) {
if err != nil {
return []*jobsdb.JobT{}, err
}
defer gz.Close()
defer func() { _ = gz.Close() }()

sc := bufio.NewScanner(gz)
// default scanner buffer maxCapacity is 64K
Expand Down Expand Up @@ -255,24 +255,24 @@ type jdWrapper struct {
queries *int32
}

func (jd jdWrapper) GetDistinctParameterValues(ctx context.Context, parameterName string) ([]string, error) {
func (jd jdWrapper) GetDistinctParameterValues(context.Context, string) ([]string, error) {
atomic.AddInt32(jd.queries, 1)
return []string{}, nil
}

func (jd jdWrapper) GetUnprocessed(
ctx context.Context,
params jobsdb.GetQueryParams,
context.Context,
jobsdb.GetQueryParams,
) (jobsdb.JobsResult, error) {
atomic.AddInt32(jd.queries, 1)
return jobsdb.JobsResult{}, nil
}

func (jd jdWrapper) UpdateJobStatus(
ctx context.Context,
statusList []*jobsdb.JobStatusT,
customValFilters []string,
parameterFilters []jobsdb.ParameterFilterT,
context.Context,
[]*jobsdb.JobStatusT,
[]string,
[]jobsdb.ParameterFilterT,
) error {
atomic.AddInt32(jd.queries, 1)
return nil
Expand Down
Loading