Skip to content

S3C-11127: publish addressed notification entries behind a delivery pool flag - #2799

Draft
anurag4DSB wants to merge 3 commits into
development/9.3from
poc/S3C-11127-w1-populator
Draft

S3C-11127: publish addressed notification entries behind a delivery pool flag#2799
anurag4DSB wants to merge 3 commits into
development/9.3from
poc/S3C-11127-w1-populator

Conversation

@anurag4DSB

Copy link
Copy Markdown
Contributor

Intent: why does this change exist?

Today every notification destination runs its own consumer group over a shared topic, so N destinations each read every message and we pay N times the reads. This is the populator half of a POC that addresses each record to its destination instead, so a single shared pool can deliver for all of them.

System impact: what's affected, including downstream?

Only the notification populator, and only when the new extensions.notification.deliveryPool.enabled flag is on. It adds one config block, a per-destination spreadFactor, and a small key helper that the replay tool will carry an identical copy of. Nothing consumes the new delivery topic yet; the worker arrives in a separate PR.

Preserved behavior: what explicitly stays the same?

With the flag off, which is the default, the populator behaves exactly as before. The existing fan-out moved verbatim into _publishLegacyEntries, including a pushedToTopic map that is declared as a Map but used with bracket access, deliberately left alone so flag-off stays byte-identical.

Intended change: what's different after this PR?

With the flag on, the populator publishes one record per matching destination onto a single delivery topic, carrying destinationId and configurationId in the payload, keyed so the same destination and object always land on the same partition.

Worth knowing before you read spreadFactor: it buys you AT MOST that many parallel lanes, never exactly that many. Sub-keys collide under the partitioner, so on a 4-partition topic a spreadFactor of 4 yields exactly 2 lanes for every possible destination name. Sizing guidance is in the POC design notes.

Verification: how do we know this worked, or how would we know if it didn't?

Unit suite green, 182 in tests/unit/notification, with the pre-existing assertions untouched. The flag-off claim is checked mechanically rather than by eye: the moved block diffs clean against the original once the indentation shift is normalized. Beyond unit tests, the real publish path ran against a live Kafka broker, confirming the wire keys, per-destination routing and partition stability across processes.

The key maps a destination and an object to a stable record key, so the
same object always lands on the same partition of the delivery topic.
A destination with a spread factor above 1 is split over that many keys
to let several delivery workers share it.
Adds the deliveryPool block, disabled by default, and the per-destination
spreadFactor. topic and groupId are only required once the pool is
enabled, so existing configurations keep validating unchanged.
Splits the destination fan-out in two: the existing path, moved as is, and
a new one that publishes one record per matching destination on the shared
delivery topic, carrying destinationId and configurationId in the payload
instead of encoding the destination in the topic. With the pool disabled
the populator behaves exactly as before.
@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.53%. Comparing base (d5ad38f) to head (4e415b4).

Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
...nsions/notification/NotificationConfigValidator.js 100.00% <ø> (ø)
...ensions/notification/NotificationQueuePopulator.js 98.48% <100.00%> (+0.30%) ⬆️
extensions/notification/utils/deliveryKey.js 100.00% <100.00%> (ø)

... and 3 files with indirect coverage changes

Components Coverage Δ
Bucket Notification 80.97% <100.00%> (+0.69%) ⬆️
Core Library 80.60% <ø> (-0.56%) ⬇️
Ingestion 70.63% <ø> (ø)
Lifecycle 78.96% <ø> (ø)
Oplog Populator 85.83% <ø> (ø)
Replication 59.70% <ø> (ø)
Bucket Scanner 85.76% <ø> (ø)
@@                 Coverage Diff                 @@
##           development/9.3    #2799      +/-   ##
===================================================
- Coverage            74.70%   74.53%   -0.18%     
===================================================
  Files                  199      200       +1     
  Lines                13629    13658      +29     
===================================================
- Hits                 10182    10180       -2     
- Misses                3437     3468      +31     
  Partials                10       10              
Flag Coverage Δ
api:retry 9.13% <0.00%> (-0.02%) ⬇️
api:routes 8.95% <0.00%> (-0.02%) ⬇️
bucket-scanner 85.76% <ø> (ø)
ft_test:queuepopulator 9.05% <0.00%> (-1.29%) ⬇️
ingestion 12.53% <0.00%> (-0.03%) ⬇️
lib 7.67% <0.00%> (-0.01%) ⬇️
lifecycle 18.81% <0.00%> (-0.05%) ⬇️
notification 1.04% <0.00%> (-0.01%) ⬇️
oplogPopulator 0.14% <0.00%> (-0.01%) ⬇️
replication 18.47% <0.00%> (-0.05%) ⬇️
unit 51.25% <100.00%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant