-
Notifications
You must be signed in to change notification settings - Fork 284
GC support CDC #22779
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
base: 3.0-dev
Are you sure you want to change the base?
GC support CDC #22779
Conversation
PR Compliance Guide 🔍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 |
||||||||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
This reverts commit 4b24044.
User description
What type of PR is this?
Which issue(s) this PR fixes:
issue #22296
What this PR does / why we need it:
GC support CDC
PR Type
Enhancement
Description
Add CDC (Change Data Capture) support to garbage collection system
Implement CDC watermark tracking for database-level protection
Extend GC filtering logic to protect CDC-related objects
Add comprehensive test coverage for CDC metadata handling
Diagram Walkthrough
File Walkthrough
checkpoint.go
Add CDC watermark retrieval and passing to GC executionpkg/vm/engine/tae/db/gc/v3/checkpoint.go
cdcTablesFuncoptional field for testing CDC table retrievalGetCDCsLocked()method to fetch CDC data from snapshotmetadata
CDCTables()method with fallback to actual CDC dataretrieval
cdcWatermarksparameter toExecuteGlobalCheckpointBasedGC()callsexec_v1.go
Integrate CDC watermarks into GC job filtering logicpkg/vm/engine/tae/db/gc/v3/exec_v1.go
cdcWatermarksfield toCheckpointBasedGCJobstructNewCheckpointBasedGCJob()constructor to accept CDC watermarkscdcWatermarksand file service parameters toMakeSnapshotAndPitrFineFilter()non-snapshot objects
based on watermark timestamps
types.go
Add CDC tables method to Cleaner interfacepkg/vm/engine/tae/db/gc/v3/types.go
CDCTables()method to Cleaner interfacewindow.go
Pass CDC watermarks through GC window executionpkg/vm/engine/tae/db/gc/v3/window.go
cdcWatermarksparameter toExecuteGlobalCheckpointBasedGC()methodsignature
NewCheckpointBasedGCJob()constructorsnapshot.go
Add CDC watermark metadata tracking and extractionpkg/vm/engine/tae/logtail/snapshot.go
CdcTidIdxconstant to table info type enumerationname, table name, watermark, error message)
specialTableInfostruct to handle PITR and CDC table datauniformly
specialTableInfostructurecdcfield inSnapshotMetaGetCDC()method to extract database-level minimum watermarksfrom CDC records
GetTableIDToDBIDMap()method for efficient table-to-database IDmapping
RebuildCdc()method for restoring CDC table IDs from persistedmetadata
mock_cleaner.go
Add CDC tables method to mock cleanerpkg/vm/engine/tae/db/gc/v3/mock_cleaner.go
CDCTables()method stub to MockCleaner interface implementationdb_test.go
Add comprehensive CDC metadata integration testpkg/vm/engine/tae/db/test/db_test.go
TestCdcMeta()test function with 400+ linesmo_cdc_watermarkstructuretimestamps
snapshot_test.go
Fix import ordering in snapshot testpkg/vm/engine/tae/logtail/snapshot_test.go
external packages)