yx-keith opened a new pull request, #71410:
URL: https://github.com/apache/doris/pull/71410

   ### Background
   
   A Table Stream snapshot reconstructs the base table at each partition's 
consumption offset. For a changed Merge-on-Write partition, it merges base rows 
at or before the offset with the first before images from the changelog.
   
   ### What problem does this PR solve?
   
   Issue Number: close #70277
   Related PR: #66849 (introduced equal-endpoint suppression)
   PR Type: Bugfix
   
   Problem Summary: If `(1, 'a')` is rewritten with the same values after the 
consumption offset, the base scan excludes its new commit TSO and the MIN_DELTA 
scan drops its change group. The snapshot can consequently omit a key that 
existed at the offset. Carry snapshot intent to the changelog reader so it can 
retain the required before image.
   
   ### Details
   
   - **Frequency:** Not observed in a running cluster. The source-level trigger 
is a same-value upsert, a delete followed by reinsertion of the same value, or 
a value round trip after the offset.
   - **Root cause:** BlockReader suppresses groups with equal before and after 
values for both ordinary net-delta reads and snapshot reconstruction.
   - **Why existing tests missed it:** `MinDeltaNoOpUpdateIsSkipped` checks 
ordinary MIN_DELTA reads. The existing Table Stream snapshot regression 
exercises changed rows and deletes without covering equal endpoints after a 
rewrite.
   - **Fix:** Pass an optional snapshot flag with the scan range and bypass 
equal-endpoint suppression in the reader for snapshot reconstruction. Keep 
per-key folding and the existing snapshot filter for DELETE and UPDATE_BEFORE.
   - **Other paths and branches:** IVM pre-refresh snapshots share this path. 
Ordinary MIN_DELTA reads keep their current behavior. The flag defaults to 
false when absent. Affected release branches have not been established.
   
   ### Testing
   
   Source inspection confirmed the failure path on upstream master. Rebased the 
patch onto `5de306be631`. The patch was identical in `git range-diff`. `git 
diff --check`, BE build hygiene, and a static check of the optional Thrift 
field ID against master and branches 3.1 through 4.2 passed. The patch adds a 
BlockReader unit test and SQL regressions for Table Stream snapshots, ordinary 
MIN_DELTA, and IVM left joins. Builds, unit tests, and SQL regressions are 
pending.
   
   ### Release note
   
   Table Stream snapshots retain rows that were rewritten to the same value 
after the consumption offset. Incremental join refreshes can use those rows 
from the reconstructed pre-refresh snapshot.
   
   ### Check List (For Author)
   
   - Behavior changed: No
   - Does this need documentation: No
   - Pre-submission status: Partially verified: build, unit tests, and SQL 
regressions are pending.
   
   ### AI Disclosure
   
   - Tool: Codex.
   - Generated: Code, tests, and the initial description draft.
   - Human review: Not stated.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to