Skip to content

Commit f471b1d

Browse files
rudder-devbox[bot]rudder-devboxmihir20
authored
refactor: remove archiveInPreProcess processor toggle (#7205)
# Description - Remove Processor.archiveInPreProcess from processor config loading. - Always store archive jobs during preprocessStage and clear archivalJobs before downstream processing. - Simplify pretransformStage to only store event schema jobs. - Update archival tests and remove the source hydration env override for the deleted toggle. ## Linear Ticket PIPE-3195 ## Validation - `gofmt -w processor/processor.go processor/processor_test.go integration_test/srchydration/src_hydration_test.go` - `go test ./processor -run TestArchival` passed - `rg "archiveInPreProcess|Processor\\.archiveInPreProcess" /workspace/rudder-server` returned no matches (rg exit 1 as expected) - `go test ./integration_test/srchydration -run TestSrcHydration` was attempted; see known issue below ## ⚠️ Known Issues - `go test ./integration_test/srchydration -run TestSrcHydration` failed in this environment because err_idx jobs never reached succeeded while the error-index reporter attempted external S3 bucket `rudder-saas` and hit AWS HeadBucket 403 / S3 config RootCAs errors instead of using local MinIO. The non-failing hydration subtests passed. ## Security - [x] The code changed/added as part of this pull request won't create any security issues with how the software is being used. --------- Co-authored-by: tech-infra-rudderstack <tech-infra+github-signing@rudderstack.com> Co-authored-by: Mihir Gandhi <mihir20121997@gmail.com>
1 parent 762bc06 commit f471b1d

4 files changed

Lines changed: 346 additions & 385 deletions

File tree

integration_test/srchydration/src_hydration_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,6 @@ func runRudderServer(t testing.TB, ctx context.Context, cancel context.CancelFun
549549
t.Setenv(configKeyToEnv("recovery.enabled"), "false")
550550
t.Setenv(configKeyToEnv("Profiler.Enabled"), "false")
551551
t.Setenv(configKeyToEnv("Gateway.enableSuppressUserFeature"), "false")
552-
t.Setenv(configKeyToEnv("Processor.archiveInPreProcess"), "true")
553552
t.Setenv(configKeyToEnv("Processor.SourceHydration.maxRetry"), "2")
554553
t.Setenv(configKeyToEnv("enableStats"), "false")
555554
if minioResource != nil {

processor/processor.go

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ type Handle struct {
200200
pythonTransformConfig transformerutils.PythonTransformConfig
201201
userTransformationMirroringBlockedIDs config.ValueLoader[[]string]
202202
storeSamplerEnabled config.ValueLoader[bool]
203-
archiveInPreProcess bool
204203
}
205204

206205
drainConfig struct {
@@ -818,7 +817,6 @@ func (proc *Handle) loadConfig() {
818817
proc.config.transformTimesPQLength = proc.conf.GetIntVar(5, 1, "Processor.transformTimesPQLength")
819818
// GWCustomVal is used as a key in the jobsDB customval column
820819
proc.config.GWCustomVal = proc.conf.GetStringVar("GW", "Gateway.CustomVal")
821-
proc.config.archiveInPreProcess = proc.conf.GetBoolVar(false, "Processor.archiveInPreProcess")
822820
proc.config.pythonTransformConfig = transformerutils.LoadPythonTransformConfig(proc.conf)
823821
proc.loadReloadableConfig(defaultPayloadLimit, defaultMaxEventsToProcess)
824822
}
@@ -2212,12 +2210,10 @@ func (proc *Handle) preprocessStage(partition string, subJobs subJob, delay time
22122210
return nil, fmt.Errorf("len(statusList):%d != len(jobList):%d", len(statusList), len(jobList))
22132211
}
22142212

2215-
if proc.config.archiveInPreProcess {
2216-
if err := proc.storeArchiveJobs(ctx, archivalJobs); err != nil {
2217-
return nil, err
2218-
}
2219-
archivalJobs = nil
2213+
if err := proc.storeArchiveJobs(ctx, archivalJobs); err != nil {
2214+
return nil, err
22202215
}
2216+
archivalJobs = nil
22212217

22222218
return &srcHydrationMessage{
22232219
partition: partition,
@@ -2258,30 +2254,11 @@ func (proc *Handle) pretransformStage(partition string, preTrans *preTransformat
22582254
groupedEvents := make(map[string][]types.TransformerEvent)
22592255
uniqueMessageIdsBySrcDestKey := make(map[string]map[string]struct{})
22602256

2261-
if !proc.config.archiveInPreProcess {
2262-
g, groupCtx := errgroup.WithContext(ctx)
2263-
2264-
g.Go(func() error {
2265-
return proc.storeEventSchemaJobs(groupCtx,
2266-
lo.Flatten(lo.MapToSlice(preTrans.eventSchemaJobsBySourceId, func(_ SourceIDT, jobs []*jobsdb.JobT) []*jobsdb.JobT {
2267-
return jobs
2268-
})))
2269-
})
2270-
2271-
g.Go(func() error {
2272-
return proc.storeArchiveJobs(groupCtx, preTrans.archivalJobs)
2273-
})
2274-
2275-
if err := g.Wait(); err != nil {
2276-
return nil, err
2277-
}
2278-
} else {
2279-
if err := proc.storeEventSchemaJobs(ctx,
2280-
lo.Flatten(lo.MapToSlice(preTrans.eventSchemaJobsBySourceId, func(_ SourceIDT, jobs []*jobsdb.JobT) []*jobsdb.JobT {
2281-
return jobs
2282-
}))); err != nil {
2283-
return nil, err
2284-
}
2257+
if err := proc.storeEventSchemaJobs(ctx,
2258+
lo.Flatten(lo.MapToSlice(preTrans.eventSchemaJobsBySourceId, func(_ SourceIDT, jobs []*jobsdb.JobT) []*jobsdb.JobT {
2259+
return jobs
2260+
}))); err != nil {
2261+
return nil, err
22852262
}
22862263

22872264
// REPORTING - START

0 commit comments

Comments
 (0)