[core] Do not count a retracted partial-update sum twice #1549
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.39) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 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 #1549"
general
weight: 0.35
JeonDaehong
Purpose
Closes #1543.
With a sequence group and a
sumaggregate, a merge that starts with a retraction seeded the row from the retracted record, so the retraction cancelled its own payload and the old value was counted again.+I(90)and then-U(90), +U(90)read 180. This follows apache/paimon#11274, which fixes the same behavior in Java.Brief change log
ignore-delete, a merge that starts with a retraction seeds only the required fields. A requiredsumstarts at zero and nullable fields stay NULL.retraction_result. Forsumit flips the sign, so a later merge that retracts it again subtracts the right amount.Tests
pk_partial_update_first_retract_testcovers a retraction and an update in one commit, a retraction-only commit before an update, and a required sum whose sequence group is skipped. The first two also read again after a compaction. All three fail on main.Two existing tests pinned the old seeding and now expect what Java returns with apache/paimon#11274 (checked on that branch merged with master):
partial_update_retract_only_aggregate_state_refuses_lossy_compaction:-D(10),-D(5),+I(3)on a summed field read-2, which is the double count itself. It now reads-12.partial_update_ignore_retract_first_value_preserves_uninitialized_state:-D(version 3, 20)then+I(version 2, 5)on anignore-retractfirst_valueread(3, 20). The DELETE no longer seeds the value, so it reads(3, NULL).I also wrote random +I/+U/-U/-D sequences on one key and split them into commits in different ways, with and without full compactions, covering nullable and required sums,
ignore-delete, null sequence values and amounts, and the lookup changelog producer. Main read the wrong sum for 326 of 1,400 sequences, this branch for none of 2,100.API and Format
No public API or storage format changes.
Documentation
None.