-
Notifications
You must be signed in to change notification settings - Fork 288
(fix): cdc stale watermark cleanup 3.0 #22815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(fix): cdc stale watermark cleanup 3.0 #22815
Conversation
PR Compliance Guide 🔍(Compliance updated until commit 3807943)Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label Previous compliance checksCompliance check up to commit 839a1c2
|
||||||||||||||||||||||||||||||||||||||||||||||||
User description
What type of PR is this?
Which issue(s) this PR fixes:
issue #22718
What this PR does / why we need it:
cdc stale watermark cleanup 3.0
PR Type
Bug fix
Description
Add orphan watermark cleanup mechanism with periodic deletion
Implement cleanup period and warning threshold configuration
Change logging levels from Info to Debug for reduced verbosity
Add early context cancellation check in RequestMultipleCn
Remove automatic context cancellation on UnRegister
Diagram Walkthrough
File Walkthrough
sql_builder.go
Add orphan watermark deletion SQL builderpkg/cdc/sql_builder.go
DeleteOrphanWatermarkSQL()method to generate SQL for cleaningorphaned watermarks
orphaned entries
table_scanner.go
Implement periodic orphan watermark cleanup mechanismpkg/cdc/table_scanner.go
DefaultWatermarkCleanupPeriod(10 minutes) andDefaultCleanupWarnThreshold(5 seconds)cleanupPeriodandcleanupWarnfields to TableDetector structfunction
cleanupTickerin scanTableLoop to trigger periodic cleanupcleanupOrphanWatermarks()method to execute orphan watermarkdeletion with error handling and performance logging
scanTableLoop, and callback success messages
table_scanner_test.go
Update test fixtures with cleanup configurationpkg/cdc/table_scanner_test.go
cleanupPeriodandcleanupWarnfields in all TableDetectortest instances
test execution
query_service.go
Add early context cancellation checkpkg/queryservice/query_service.go
RequestMultipleCn function
requests