Repository navigation
[4.2-dev] fix(disttae): preserve exact PK reads across transferred deletes - #32692
Conversation
(cherry picked from commit 50bb07c)
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Queue requested — the merge queue status continues in this comment ↓. |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 3eb60dddf21c46b717e0bdf7274cc46754f7a735
Assessment: approve
The backport restores exact unique-PK reads across transferred deletes while preserving snapshot visibility and complete physical-row delete iteration. Iterator-local termination reuses existing validation and avoids scanning obsolete insertion history; no actionable defect remains.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
Validation:
-
Reviewed the complete three-file delta, primary-key producers/readers/GC, scheduler boundaries, linked issue and all PR discussion; saved the review plan and discussion assessment.
-
Branch-matched Go 1.26.4, native prerequisites and isolation preflight passed. Full logtailreplay package: 321 test/subtest passes, one existing skip. Controlled SQL regression: all 16 checks passed.
-
Baseline production-function overlay retained identical candidate tests: 0/1/2-transfer controls passed; 3/8-transfer cases failed. Only the final-stage exact SELECT and FOR UPDATE missed the row; prefix/full controls passed.
-
Clean-source, whitespace and formatting checks passed. All local claims are matched to terminal receipts and retained logs in validation-evidence.json; supplied exact-head branch CI also reports successful build, UT/coverage, SCA and multi-CN BVT.
Limitations:
-
The SQL fixture controls Flush commits and uses test RPC/lock adapters; it does not establish automatic-scheduler frequency, production multi-CN behavior or resolution of allocator incident #32515.
-
The full engine/test suite, author lint and microbenchmarks were not independently rerun locally.
✅ Merged into
|
What type of PR is this?
Which issue(s) this PR fixes:
Backport of #32668 to
4.2-dev, addressing #32660 on this release branch.What this PR does / why we need it:
Cherry-pick
50bb07caae467c08b951154757933323e5c607fawith-x, onto4.2-dev@2397892f71a937903f72dab41bd2199479102eef. There were no conflictsand no branch-specific source or test adaptations.
logtailreplay.Exactmust not infer that a unique PK is absent after inspectingonly three historical candidates. Multiple transferred deletes can precede the
live insertion and consume that budget. The old implementation returns an empty
SQL result without an error, while prefix/full scans find the same row.
The patch changes only iterator-local termination:
snapshot using the existing RowID/version visibility logic, then finish.
No TN, Flush scheduler, lock protocol, persistence format, allocator/FATAL, shared
state or retry changes. No main-only cluster-key/range changes are included.
Branch-specific validation
Validation runs on host 50 in an isolated worktree with a fresh 4.2 native build,
Go 1.26.4 linux/amd64, GOMAXPROCS=2 and build parallelism 1. Main CI evidence is
not substituted for branch-specific checks.
Baseline retains the exact cherry-picked tests and reverses only the production
function change:
third controlled Flush commit, exact SELECT and FOR UPDATE return no rows;
prefix/full return
(3,1)in the same fixed SI transaction, with no SQL error.Patched candidate:
Identical SQL oracle: 16/16 checks pass, body 0.53s.
Full
pkg/vm/engine/disttae/logtailreplay: PASS, 0.278s.Full
pkg/vm/engine/test: PASS, 155.151s.Four existing skipped tests remain skipped, not credited as passes.
Three-sample microbench medians (ns/op):
1024 preceding transferred deletes: 10.998 us median, fixed 810 B /
10 allocations per lookup. The one-version live median is +2.5% in this short
shared-host test; this is not a full-workload performance guarantee.
Full two-package golangci-lint from the branch-pinned v2.6.2 source, built with
Go1.26.4 and using unchanged
.golangci.yml: PASS, 0 issues. No new filtersor exclusions. An initial Go1.27-built linter produced a formatter mismatch
on an unchanged file; it was corrected by matching the toolchain, not by
changing unrelated code.
Final scope-aware self-review, branch-native gofmt and
git diff --checkpass.GitHub CI for this backport is separate and must still pass before merging.
Evidence boundaries
The SQL fixture holds three real Flush commits and passes no source tombstone
objects. It bypasses automatic flusher admission/order and uses EnginePack's
test RPC/lock adapters. Normal automatic-scheduler reachability/frequency is not
proved. This is not a production multi-CN reproduction, proof of durable loss,
or a claim that #32515 has been diagnosed/fixed.
Skipped-delete work is linear in the same-key prefix. There is no new per-entry
allocation/I/O/wait, and ordinary update history terminates after the newest
insertion. Microbenchmarks do not guarantee production tail latency.