Skip to content

fix(tae): preserve replacement rows across merge tombstones - #29283

Merged
XuPeng-SH merged 7 commits into
matrixorigin:mainfrom
jiangxinmeng1:codex/repro-getbyfilter-upstream-main
Sep 24, 2026
Merged

XuPeng-SH merged 7 commits into
matrixorigin:mainfrom
jiangxinmeng1:codex/repro-getbyfilter-upstream-main

Conversation

@jiangxinmeng1

@jiangxinmeng1 jiangxinmeng1 commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #29284

What this PR does / why we need it:

Keep primary-key candidates from appendable and non-appendable objects separately during point lookup and snapshot dedup. Apply tombstone filtering to both candidates before choosing the effective row, preferring the appendable replacement row.

This fixes the sequence where a merge output is selected first, its transferred tombstone removes that RowID, and GetByFilter incorrectly reports not found, allowing a duplicate append.

Validation

  • TestGetByFilterAfterMergeKeepsTheNewAppend
  • pkg/vm/engine/tae/txn/txnimpl package tests
  • The regression verifies GetByFilter succeeds and a second append of the same PK returns duplicate.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GPT-6 High deep review of exact head 8716869b6d5242133d5cf0754490d6dbaebb262a found two correctness blockers.\n\nP1 — A flushed replacement and a later merge output can occupy the same non-appendable candidate slot, allowing the live replacement to be erased. Reachable sequence: build merge output containing old key K; commit replacement K; flush replacement to a non-appendable object; commit the original merge. The replacement and merge output both write the same candidate vector slot, and the later transferred tombstone clears the retained row. GetByFilter can report not found and snapshot dedup can accept another K. Please cover this flush-before-merge-commit ordering and retain both same-class candidates until tombstone resolution. Candidate assignment.\n\nP2 — A tolerated WW conflict discards completed tombstone filtering and may return an already-deleted row. findDeletesForCandidates filters a combined vector but copies the changes back only after findDeletes returns nil. If an appendable old row was cleared and a later non-appendable candidate hits WW conflict, GetByFilter tolerates the conflict and merges the unchanged candidates, preferring the stale appendable row; the workspace-only deletion check does not catch the committed tombstone. Please preserve partial filtering on the tolerated conflict path or propagate the conflict. Early return.\n\nExact-head CI was green (race UT, SCA, coverage, active BVT). The added regression does not exercise either counterexample.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GPT-6 high review — APPROVE at exact head 8d15653.

Reviewed candidate deduplication and replacement behavior, including appendability and tombstone filtering. No blocking findings.

@mergify mergify Bot added the queued label Sep 24, 2026
@mergify

mergify Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-09-24 09:19 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🟠 Checks running · in-place
  • 🚫 Left the queue — 2026-09-24 09:40 UTC · at 24fbe6367047fab1df1147a7bb8ddeb967d1d88d

This pull request spent 21 minutes 12 seconds in the queue, with no time running CI.

Reason

Pull request #29283 has been dequeued

Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.

> The author needs to enable ["Allow edits from maintainers"](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) on this pull request.

Hint

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Waiting for any of
  • check-neutral = CI Required
  • check-skipped = CI Required
  • check-success = CI Required
All conditions

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

@XuPeng-SH
XuPeng-SH merged commit 3da27b1 into matrixorigin:main Sep 24, 2026
24 of 25 checks passed
@mergify mergify Bot added dequeued and removed queued labels Sep 24, 2026

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants