Skip to content

Commit

Permalink
chore: increase archiver postgres shm size
Browse files Browse the repository at this point in the history
  • Loading branch information
cisse21 committed Oct 30, 2023
1 parent f014c01 commit 0caf046
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
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

0 comments on commit 0caf046

Please sign in to comment.