[flink] Keep delete records in the COMPACT_DELTA lookup refresh #10924
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 315 lines diff across 3 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.344
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #10924"
general
weight: 0.35
LuciferYang
Purpose
close #10923
With
lookup.cache = full(or join keys that are not the primary keys), a primary key table with the aggregation or partial-update merge engine,changelog-producer = noneand a lookup strategy refreshes the lookup cache from the difference between the files before and after each compaction.LookupCompactDiffReadread that difference without keeping delete records, so a deleted row produced no record and the cache kept returning it.The difference is now read with
forceKeepDelete(), so a deleted row reaches the cache as a delete record, both when compaction keeps the delete record and when it drops the row. The initial full load is a separate read and does not change.A delete record can carry only the key, like a sequence-group delete of a partial-update table.
SecondaryIndexLookupTableremoved the index entry by the secondary key of the delete record, so the entry of the deleted row stayed and later pointed to a reinserted row. It now removes the entry of the cached row, like an update does.Tables with deletion vectors are not covered: streaming plans carry no deletion files, so a delete that compaction only writes into a deletion vector is not visible in this difference. #10813 handles deletion vectors for the partial lookup, which is a different path.
Tests
LookupJoinITCase#testLookupJoinDeletionPropagationAfterCompaction, for both ways a compaction handles a delete on an aggregation table withaggregation.remove-record-on-delete:-
false: the delete job compacts into an intermediate level and keeps the delete record.-
true: the delete stays in level 0 (write-only), then a full compaction drops the row;$filesshows that only one level-5 file is left.In both cases the lookup join must return
(1, null)after the delete. On master it still returns(1, 10).LookupJoinITCase#testLookupJoinBySecondaryKeyAfterKeyOnlyDelete, with the full and memory caches: a partial-update table joined onf1gets the sequence-group delete(1, NULL, 2)and then(1, 22, 3). Lookup key11must return nothing after the delete and after the reinsert, and22must return the new row. On master11still returns the deleted row after the delete; without theSecondaryIndexLookupTablechange it returns(1, 22, 3)after the reinsert.LookupTableTest#testSecKeyTableDeleteWithoutSecKey: the same delete and reinsert directly on the lookup table, for both state backends.API and Format
no
Documentation
no