fix: tracking plan merged config is cached without its event type - #7314
Open
atzoum wants to merge 1 commit into
Open
fix: tracking plan merged config is cached without its event type#7314atzoum wants to merge 1 commit into
atzoum wants to merge 1 commit into
Conversation
atzoum
requested review from
fracasula,
itsmihir,
ktgowtham,
mihir20 and
saikumarrs
August 27, 2026 10:46
atzoum
force-pushed
the
fix.trackingPlanMergedConfig
branch
from
August 27, 2026 13:10
fd353cc to
38a8564
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7314 +/- ##
==========================================
+ Coverage 79.34% 79.37% +0.03%
==========================================
Files 609 609
Lines 67963 67973 +10
==========================================
+ Hits 53922 53953 +31
+ Misses 10876 10841 -35
- Partials 3165 3179 +14 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
atzoum
force-pushed
the
fix.trackingPlanMergedConfig
branch
from
August 27, 2026 13:52
38a8564 to
7388732
Compare
GetMergedConfig merges the tracking plan's global config with the config of the event type it is asked about, and memoised the result in DgSourceTrackingPlanConfigT.MergedConfig - a field with no room for the event type it was merged for. The first caller's answer was therefore returned to every later one, whatever event type it asked about. It does not misfire today: a gateway batch holds a single event and the processor takes a fresh copy of the source per job, so the memo is written once and thrown away. It would misfire the moment one source value serves two event types, and mergedTpConfig decides whether an event is dropped, so the cost of that would be event loss rather than noise. Drop the memo and the field with it: the merge is two map lookups and an lo.Assign, and it was already being recomputed for every event.
atzoum
force-pushed
the
fix.trackingPlanMergedConfig
branch
from
August 28, 2026 07:12
7388732 to
6c3b616
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
DgSourceTrackingPlanConfigT.GetMergedConfig(eventType)layers the tracking plan's config for an event type over itsglobalconfig, and memoised the result into the source's ownDgSourceTrackingPlanConfig.MergedConfig.Caching it there is both wrong and dangerous. Wrong, because the field has no room for the event type it was merged for, so the first caller's answer is handed to every later one:
Dangerous, because computing a merge should not write into the source config at all - and there is no need for it to: the merge is two map lookups and an
lo.Assign, recomputed per event today regardless, since the memo is written once per source copy and thrown away.It does not misfire as things stand (one event per gateway batch, a fresh source copy per job), but
mergedTpConfigis what decides whether an event is dropped - rudder-transformer dispatchesallowUnplannedEvents,unplannedProperties,anyOtherViolationandsendViolatedEventsTooff it, per event - so the cost of it ever misfiring is event loss rather than noise.MergedConfigis removed with it: never on the wire in either config version, and nothing outside the getter read it.fetchEventConfiggoes too - it turned an absent key into an empty map, whichlo.Assigndoes by itself.Security