Skip to content

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

Closed
mittalprince wants to merge 1 commit into
linkedin:masterfrom
mittalprince:fix-leader-assignment-dedup-hook
Closed

Add CDC+BST catch-up dedup hook in SourceBasedDeduper#1022
mittalprince wants to merge 1 commit into
linkedin:masterfrom
mittalprince:fix-leader-assignment-dedup-hook

Conversation

@mittalprince

@mittalprince mittalprince commented May 25, 2026

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 changed the title Fix leader assignment and add CDC+BST catch-up dedup hook Add CDC+BST catch-up dedup hook in SourceBasedDeduper May 25, 2026
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 fix-leader-assignment-dedup-hook branch from fd52b43 to ab7e7a3 Compare May 25, 2026 18:29
@mittalprince mittalprince deleted the fix-leader-assignment-dedup-hook branch May 26, 2026 04:28
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