[fix](ivm) Prevent NULL-row loss during outer join refresh #70630
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 365 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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
Diff Size
diff_size
0.353
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #70630"
general
weight: 0.35
morrySnow
Background
Incremental materialized views maintain outer joins by writing joined-row changes and repairs for rows whose nullable side is filled with NULL. Unique-key views apply these writes through merge-on-write keys and sequence numbers.
What problem does this PR solve?
Issue Number: None
Related PR: #62606 (introduced the bug)
PR Type: Bugfix
Problem Summary:
Incremental refresh can lose a padded NULL row when the nullable-side join subtree emits cancelling positive and negative events. Order NULL-row repairs by their operation sign so reinsertion wins when both repairs target the same row.
For a view over
l LEFT JOIN (a JOIN b), updating the outer join key inaand deleting its matchingbrow in the same refresh window produced:| Result | Rows |
|---|---|
| Before the fix, one observed incremental refresh |
(1,10,NULL)|| With the fix, incremental and complete refresh |
(1,10,NULL), (2,20,NULL)|Details
paddingSequence()ignored the repair sign. Both the NULL-row deletion and reinsertion used the same sequence, so merge-on-write could retain the deletion according to arrival order.IvmJoinDeltaHandlerTestchecked the repair sign and sequence column name without checking their ordering.test_ivm_refresh_dry_runmasks the sequence value, while final-row checks can pass when reinsertion happens to arrive last.Testing
test_ivm_outer_join_null_repair_sequencecase for equality events, residual predicates, RIGHT JOIN and FULL JOIN.Release note
None
Check List (For Author)