Skip to content

Add CDC+BST catch-up dedup hook in SourceBasedDeduper#1023

Open
mittalprince wants to merge 1 commit into
masterfrom
add-cdc-bst-catchup-dedup-hook
Open

Add CDC+BST catch-up dedup hook in SourceBasedDeduper#1023
mittalprince wants to merge 1 commit into
masterfrom
add-cdc-bst-catchup-dedup-hook

Conversation

@mittalprince

Copy link
Copy Markdown
Collaborator

Summary

  • Added protected hook isCdcBstStreamCaughtUp(Datastream) in SourceBasedDeduper (returns false by default) that subclasses can override with a real consumer group lag check
  • Updated findDedupCandidateForNewCdcOnlyStream to allow CDC-only stream to dedup against a CDC+BST stream if the grace window has expired or the hook returns true
  • Keeps OSS base class clean with no Kafka client dependency; internal implementations can plug in actual lag-based logic via subclass override

Test plan

  • Existing TestSourceBasedDeduper tests pass
  • New test testCdcOnlyNewVsExistingCdcBstCaughtUpEarly — verifies dedup succeeds before grace window when hook returns true
  • New test testCdcOnlyNewVsExistingCdcBstNotCaughtUp — verifies dedup is blocked when hook returns false

@mittalprince mittalprince force-pushed the add-cdc-bst-catchup-dedup-hook branch from ab7e7a3 to c0add3d Compare May 26, 2026 04:32
1. SourceBasedDeduper: add protected isCdcBstStreamCaughtUp(Datastream)
hook (returns false by default) so subclasses can short-circuit the
6-hour grace window when consumer-group lag has already drained.
Update findDedupCandidateForNewCdcOnlyStream to allow dedup if either
the window has expired OR the hook returns true.
2. TestSourceBasedDeduper: add two tests covering the caught-up and
not-caught-up hook paths.
@mittalprince mittalprince force-pushed the add-cdc-bst-catchup-dedup-hook branch from c0add3d to 0543475 Compare May 26, 2026 04:35
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