Repository navigation
chore: refactor processor to move archival in a preprocess stage - #6470
Conversation
676c543 to
baa0cb0
Compare
🔒 Scanned for secrets using gitleaks 8.28.0
baa0cb0 to
bd99972
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6470 +/- ##
==========================================
+ Coverage 79.23% 79.32% +0.09%
==========================================
Files 529 529
Lines 59350 59365 +15
==========================================
+ Hits 47026 47092 +66
+ Misses 9507 9454 -53
- Partials 2817 2819 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| } | ||
|
|
||
| if proc.config.archiveInPreProcess { | ||
| if err := proc.storeArchiveJobs(ctx, archivalJobs); err != nil { |
There was a problem hiding this comment.
Please verify whether my understanding is correct, with respect to what is and what is not getting archived:
- We are not archiving:
- bot events we are dropping
- blocked events
- duplicate events
- events we receive from rudder-sources
- events from transient sources
- Archived event mutations:
- their context is enriched (add geolocation & bot info)
- events with at least one available destination have the following additional mutations, others still get archived but without these mutations:
request_ipfield- time fields (
receivedAt,originalTimestamp,sentAt,timestamp)
cc @ktgowtham for visibility
itsmihir
left a comment
There was a problem hiding this comment.
LGTM, added some small comment
| proc.config.userTransformationMirroringFireAndForget = proc.conf.GetReloadableBoolVar(false, "Processor.userTransformationMirroring.fireAndForget") | ||
| proc.config.storeSamplerEnabled = proc.conf.GetReloadableBoolVar(false, "Processor.storeSamplerEnabled") | ||
|
|
||
| proc.config.archiveInPreProcess = proc.conf.GetBoolVar(false, "Processor.archiveInPreProcess") |
There was a problem hiding this comment.
we should move this to loadConfig, loadReloadableConfig is only for Reloadable config
| if err != nil { | ||
| return fmt.Errorf("store into archival table failed with error: %v", err) | ||
| } else { | ||
| if err := proc.storeEventSchemaJobs(preTrans.subJobs.ctx, preTrans.eventSchemaJobs); err != nil { |
There was a problem hiding this comment.
Why are we using preTrans.subJobs.ctx and not ctx?
There was a problem hiding this comment.
yeah, it should be ctx as it is traced one
🔒 Scanned for secrets using gitleaks 8.28.0
# Description Refactor the processor to move archival operation to a preprocess stage. ### New Configuration Option - Added a new boolean configuration `archiveInPreProcess` that controls when archival jobs are stored - When enabled, archival jobs are stored during the preprocess stage rather than the pretransform stage ### Modified Flow - Previously, both event schema jobs and archival jobs were processed in the `pretransformStage` - With the new configuration enabled, archival jobs are now processed in the `preprocessStage` - This change allows for earlier archival of events in the processing pipeline ### Context Handling - Improved context propagation in the pretransform stage - Uses the proper context for error groups when archiving in pretransform stage ### Error Handling - Maintains consistent error handling patterns throughout the archival process - Preserves retry logic with notification for storage operations ### Testing - Comprehensive test coverage for both modes of operation - Ensures backward compatibility when the feature is disabled ## Linear Ticket pipe-2484 ## Security - [ ] The code changed/added as part of this pull request won't create any security issues with how the software is being used.
🤖 I have created a release *beep* *boop* --- ## [1.63.0-rc.1](v1.62.0...v1.63.0-rc.1) (2025-11-11) ### Features * **router:** dynamic sizing of worker job buffers ([#6463](#6463)) ([5b2e519](5b2e519)) ### Bug Fixes * max procs defaults ([#6473](#6473)) ([48f9cfd](48f9cfd)) * max procs defaults ([#6473](#6473)) ([3d2026c](3d2026c)) * pending batch router jobs for disabled destinations are not being aborted ([#6477](#6477)) ([8effa78](8effa78)) * remove source labels in repo query stats ([#6483](#6483)) ([48f9cfd](48f9cfd)) * use type field from payload to check if event is blocked ([#6487](#6487)) ([5ba053f](5ba053f)) ### Miscellaneous * apply security best practices from step security ([#6462](#6462)) ([a860128](a860128)) * emit filtered metrics from all non-ut stages and clean up diff metrics ([#6485](#6485)) ([399c4c6](399c4c6)) * refactor processor to move archival in a preprocess stage ([#6470](#6470)) ([8634c3f](8634c3f)) * remove oauth status toggling ([#6492](#6492)) ([45e5dba](45e5dba)) * sync release v1.62.0 to main branch ([#6472](#6472)) ([65db4ee](65db4ee)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- ## [1.63.0](v1.62.0...v1.63.0) (2025-11-11) ### Features * **router:** dynamic sizing of worker job buffers ([#6463](#6463)) ([5b2e519](5b2e519)) ### Bug Fixes * max procs defaults ([#6473](#6473)) ([48f9cfd](48f9cfd)) * max procs defaults ([#6473](#6473)) ([3d2026c](3d2026c)) * pending batch router jobs for disabled destinations are not being aborted ([#6477](#6477)) ([8effa78](8effa78)) * remove source labels in repo query stats ([#6483](#6483)) ([48f9cfd](48f9cfd)) * use type field from payload to check if event is blocked ([#6487](#6487)) ([5ba053f](5ba053f)) ### Miscellaneous * apply security best practices from step security ([#6462](#6462)) ([a860128](a860128)) * emit filtered metrics from all non-ut stages and clean up diff metrics ([#6485](#6485)) ([399c4c6](399c4c6)) * refactor processor to move archival in a preprocess stage ([#6470](#6470)) ([8634c3f](8634c3f)) * remove oauth status toggling ([#6492](#6492)) ([45e5dba](45e5dba)) * sync release v1.62.0 to main branch ([#6472](#6472)) ([65db4ee](65db4ee)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Description
Refactor the processor to move archival operation to a preprocess stage.
New Configuration Option
archiveInPreProcessthat controls when archival jobs are storedModified Flow
pretransformStagepreprocessStageContext Handling
Error Handling
Testing
Linear Ticket
pipe-2484
Security