← Back to Pull requests

fix(common): skip CDC log files in the log block metadata scanner #20353

Open
unknown opened this pull request with 258 lines diff across 3 files
View on GitHub
unknown unknown commented on Oct 15, 2026 19:11 UTC
Author

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. HoodieLogBlockMetadataScanner builds its reader context without a schema, and a CDC data block cannot be constructed without one (Option.of(readerSchema) in HoodieCDCDataBlock). If a CDC block does get past that, BaseHoodieLogRecordReader.scanInternal rejects the block type.

Summary and Changelog

HoodieLogBlockMetadataScanner now drops CDC log files from the log files it scans. This matches HoodieMergedLogRecordScanner and HoodieUnMergedLogRecordScanner, which already skip .cdc log 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.

HoodieLogCompactionPlanGenerator also 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) and TestHoodieLogCompactionPlanGenerator (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

  • Read through contributor's guide

  • Enough context is provided in the sections above

  • Adequate tests were added if applicable
  • Diff: 258 lines (+193 / -65) across 3 files Reviewer: nanjeshramesh Review duration: 66369m
    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
    0.46
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    44%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 46.2% (MEDIUM) · Higher = larger blast radius
    46.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 44.7% · Lower = rushed or shallow review
    44.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 25.5% · Safe to merge
    25.5%
    Repository