Skip to content

to 3.0: fix: avoid duplicate rows in data branch diff replay#24141

Merged
heni02 merged 5 commits intomatrixorigin:3.0-devfrom
gouhongshen:codex/fix-range-replay-terminal-objects-3.0-dev
Apr 15, 2026
Merged

to 3.0: fix: avoid duplicate rows in data branch diff replay#24141
heni02 merged 5 commits intomatrixorigin:3.0-devfrom
gouhongshen:codex/fix-range-replay-terminal-objects-3.0-dev

Conversation

@gouhongshen
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 #23751

What this PR does / why we need it:

This is the 3.0-dev port of the main-branch fix for duplicated DATA BRANCH DIFF replay rows.

Range replay could keep both an appendable predecessor and its TN successor when the predecessor had already been deleted at or before the replay end timestamp. After GC and restart, CollectChanges then replayed the same logical row from both objects, which surfaced as duplicated INSERT output such as a repeated 5,5 row.

This change makes delete-chain resolution treat any object deleted at or before the range end as a transient intermediate, regardless of appendable state, and follow its successor so the final replay set contains only the terminal object visible at the end timestamp.

A 3.0-dev regression test is added for the appendable-predecessor case to lock the behavior down.

Treat objects deleted at or before the range end as transient intermediates during range replay regardless of appendable state, so delete-chain resolution follows the terminal successor instead of replaying both predecessor and successor objects. Add a regression test for the appendable-predecessor path on 3.0-dev.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 15, 2026 10:31
@gouhongshen gouhongshen requested a review from XuPeng-SH as a code owner April 15, 2026 10:31
@matrix-meow matrix-meow added the size/S Denotes a PR that changes [10,99] lines label Apr 15, 2026
@mergify mergify Bot added the kind/bug Something isn't working label Apr 15, 2026
@gouhongshen gouhongshen changed the title fix: avoid duplicate rows in data branch diff replay to 3.0: fix: avoid duplicate rows in data branch diff replay Apr 15, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Ports a main-branch fix to 3.0-dev to prevent duplicate rows during DATA BRANCH DIFF range replay by ensuring delete-chain resolution returns only the terminal object visible at the range end, plus adds a regression test for the appendable-predecessor case.

Changes:

  • Update delete-chain resolution to follow the successor for any object deleted at or before the replay range end (regardless of appendable state).
  • Add a regression test intended to cover the “appendable predecessor deleted before end” scenario.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
pkg/vm/engine/disttae/logtailreplay/change_handle.go Adjusts delete-chain resolution to skip transient objects deleted by range end and follow successors to avoid duplicate replay.
pkg/vm/engine/disttae/logtailreplay/change_handle_test.go Adds a new test intended to lock down the appendable-predecessor deletion case for delete-chain resolution.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/vm/engine/disttae/logtailreplay/change_handle_test.go Outdated
Write both the appendable predecessor and its successor into the in-memory file service so the 3.0-dev regression test exercises the pre-fix duplicate-replay path instead of passing via the missing-file rewrite path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mergify mergify Bot added the queued label Apr 15, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 15, 2026

Merge Queue Status

  • Entered queue2026-04-15 14:28 UTC · Rule: release-3.0
  • Checks started · in-place
  • 🚫 Left the queue2026-04-15 15:39 UTC · at 8edb470d9fb6991d8d4356b5776c38d643d6b345

This pull request spent 1 hour 10 minutes 29 seconds in the queue, with no time running CI.

Waiting for:

  • any of:
    • check-neutral = Matrixone Utils CI (3.0) / Coverage
    • check-skipped = Matrixone Utils CI (3.0) / Coverage
    • check-success = Matrixone Utils CI (3.0) / Coverage
  • any of:
    • check-neutral = Matrixone CI (3.0) / UT Test on Ubuntu/x86
    • check-skipped = Matrixone CI (3.0) / UT Test on Ubuntu/x86
    • check-success = Matrixone CI (3.0) / UT Test on Ubuntu/x86
  • any of:
    • check-neutral = Matrixone Compose CI (3.0) / multi cn e2e bvt test docker compose(Optimistic/PUSH)
    • check-skipped = Matrixone Compose CI (3.0) / multi cn e2e bvt test docker compose(Optimistic/PUSH)
    • check-success = Matrixone Compose CI (3.0) / multi cn e2e bvt test docker compose(Optimistic/PUSH)
  • any of:
    • check-neutral = Matrixone Compose CI (3.0) / multi cn e2e bvt test docker compose(PESSIMISTIC)
    • check-skipped = Matrixone Compose CI (3.0) / multi cn e2e bvt test docker compose(PESSIMISTIC)
    • check-success = Matrixone Compose CI (3.0) / multi cn e2e bvt test docker compose(PESSIMISTIC)
  • any of:
    • check-neutral = Matrixone Standlone CI (3.0) / Multi-CN e2e BVT Test on Linux/x64(LAUNCH, PROXY)
    • check-skipped = Matrixone Standlone CI (3.0) / Multi-CN e2e BVT Test on Linux/x64(LAUNCH, PROXY)
    • check-success = Matrixone Standlone CI (3.0) / Multi-CN e2e BVT Test on Linux/x64(LAUNCH, PROXY)
  • any of:
    • check-neutral = Matrixone Standlone CI (3.0) / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI (3.0) / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-success = Matrixone Standlone CI (3.0) / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
  • any of:
    • check-neutral = Matrixone Standlone CI (3.0) / e2e BVT Test on Linux/x64(LAUNCH,Optimistic)
    • check-skipped = Matrixone Standlone CI (3.0) / e2e BVT Test on Linux/x64(LAUNCH,Optimistic)
    • check-success = Matrixone Standlone CI (3.0) / e2e BVT Test on Linux/x64(LAUNCH,Optimistic)
  • any of:
    • check-neutral = Matrixone Upgrade CI (3.0) / Compatibility Test With Target on Linux/x64(LAUNCH)
    • check-skipped = Matrixone Upgrade CI (3.0) / Compatibility Test With Target on Linux/x64(LAUNCH)
    • check-success = Matrixone Upgrade CI (3.0) / Compatibility Test With Target on Linux/x64(LAUNCH)
All conditions
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone Utils CI (3.0) / Coverage
    • check-skipped = Matrixone Utils CI (3.0) / Coverage
    • check-success = Matrixone Utils CI (3.0) / Coverage
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone CI (3.0) / UT Test on Ubuntu/x86
    • check-skipped = Matrixone CI (3.0) / UT Test on Ubuntu/x86
    • check-success = Matrixone CI (3.0) / UT Test on Ubuntu/x86
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone Compose CI (3.0) / multi cn e2e bvt test docker compose(Optimistic/PUSH)
    • check-skipped = Matrixone Compose CI (3.0) / multi cn e2e bvt test docker compose(Optimistic/PUSH)
    • check-success = Matrixone Compose CI (3.0) / multi cn e2e bvt test docker compose(Optimistic/PUSH)
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone Compose CI (3.0) / multi cn e2e bvt test docker compose(PESSIMISTIC)
    • check-skipped = Matrixone Compose CI (3.0) / multi cn e2e bvt test docker compose(PESSIMISTIC)
    • check-success = Matrixone Compose CI (3.0) / multi cn e2e bvt test docker compose(PESSIMISTIC)
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone Standlone CI (3.0) / Multi-CN e2e BVT Test on Linux/x64(LAUNCH, PROXY)
    • check-skipped = Matrixone Standlone CI (3.0) / Multi-CN e2e BVT Test on Linux/x64(LAUNCH, PROXY)
    • check-success = Matrixone Standlone CI (3.0) / Multi-CN e2e BVT Test on Linux/x64(LAUNCH, PROXY)
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone Standlone CI (3.0) / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI (3.0) / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-success = Matrixone Standlone CI (3.0) / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone Standlone CI (3.0) / e2e BVT Test on Linux/x64(LAUNCH,Optimistic)
    • check-skipped = Matrixone Standlone CI (3.0) / e2e BVT Test on Linux/x64(LAUNCH,Optimistic)
    • check-success = Matrixone Standlone CI (3.0) / e2e BVT Test on Linux/x64(LAUNCH,Optimistic)
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone Upgrade CI (3.0) / Compatibility Test With Target on Linux/x64(LAUNCH)
    • check-skipped = Matrixone Upgrade CI (3.0) / Compatibility Test With Target on Linux/x64(LAUNCH)
    • check-success = Matrixone Upgrade CI (3.0) / Compatibility Test With Target on Linux/x64(LAUNCH)
  • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
  • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
  • branch-protection-review-decision = APPROVED [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI (3.0) / SCA Test on Ubuntu/x86
    • check-neutral = Matrixone CI (3.0) / SCA Test on Ubuntu/x86
    • check-skipped = Matrixone CI (3.0) / SCA Test on Ubuntu/x86

Reason

Pull request #24141 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" 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.

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

Labels

dequeued kind/bug Something isn't working size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants