fix(common): skip CDC log files in the log block metadata scanner #20353
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.46) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 258 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.332
Real PR Conversation Timeline
1 comments
"Review active on #20353"
general
weight: 0.35
nanjeshramesh
Describe the issue this Pull Request addresses
Closes #20325
Scheduling log compaction throws when a Merge-on-Read file slice contains CDC log files and the planner takes the block metadata scanning path.
HoodieLogBlockMetadataScannerbuilds its reader context without a schema, and a CDC data block cannot be constructed without one (Option.of(readerSchema)inHoodieCDCDataBlock). If a CDC block does get past that,BaseHoodieLogRecordReader.scanInternalrejects the block type.Summary and Changelog
HoodieLogBlockMetadataScannernow drops CDC log files from the log files it scans. This matchesHoodieMergedLogRecordScannerandHoodieUnMergedLogRecordScanner, which already skip.cdclog files because they only carry supplemental change data and are never merged into the base file. Files are matched on the CDC log file suffix, so it also covers tables where CDC was disabled after CDC logs were written.HoodieLogCompactionPlanGeneratoralso leaves CDC log files out of its log file count. That shortcut runs before the scanner, so without this a slice with only CDC log files would still be scheduled with nothing to compact.Added
TestHoodieLogBlockMetadataScanner(a regular data log file and a CDC log file for the same file group, scanned together) andTestHoodieLogCompactionPlanGenerator(CDC log files alone do not make a slice eligible, enough regular log files still do). Both fail on master and pass with this change.Impact
Log compaction scheduling no longer fails on file slices that have CDC log files. File slices whose log files are all CDC logs are no longer scheduled for log compaction. Other slices are chosen as before.
Risk Level
low. The scanner only inspects block metadata, and CDC blocks were never part of what it reports.
Documentation Update
none
Contributor's checklist