[core] Reclaim consumed merge batches with pending output #1390
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.44) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.44 · 254 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
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #1390"
general
weight: 0.35
JeonDaehong
Purpose
Linked issue: close #1386
A partially filled output batch keeps
output_indicesnonempty. If many later keys are omitted because their winning rows are retracts, consumed source batches remain inbatch_bufferuntil the output fills or input ends. Reclaim unrelated batches while keeping both cursor and pending-output references valid.Brief change log
Tests
cargo +1.95.0 test --locked -p paimon --lib table::sort_merge::tests: 42 passed.cargo +1.95.0 test --locked -p paimon --lib: 4,860 passed, 6 ignored.-D warnings -A clippy::nonminimal_bool. Strict Clippy's six existing nonminimal-bool errors were reproduced on unmodified main; no source lint suppressions were added.cargo +1.95.0 fmt --all -- --checkandgit diff --check: passed.Local Cargo builds used debug info disabled and incremental compilation disabled. The regression measures retained source-array ownership, not RSS. This change does not establish a byte budget for all merge state or address a single key with arbitrarily many versions.
API and Format
No public API or storage-format changes. Pending output retains its original rows and order; output batch sizing is unchanged.
Documentation
Update the buffer ownership and compaction comments beside the implementation.
AI assistance: Codex helped develop the implementation, regression, and this description.