Skip to content

fix(backup): reuse immutable objects across incremental backups - #32172

Merged
XuPeng-SH merged 5 commits into
matrixorigin:mainfrom
LeftHandCold:fix/backup-immutable-incremental-main-20261104
Nov 5, 2026
Merged

XuPeng-SH merged 5 commits into
matrixorigin:mainfrom
LeftHandCold:fix/backup-immutable-incremental-main-20261104

Conversation

@LeftHandCold

Copy link
Copy Markdown
Collaborator

What type of PR is this?

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

Which issue(s) this PR fixes:

Fixes #32169

What this PR does / why we need it:

An immutable object's later DeleteTS must not turn its existing payload into a new incremental-backup copy. That unnecessary source read can fail after GC even though an earlier backup already contains the file.

Use CreateTS for immutable-object copy selection and retain the flush/drop check for appendable objects. Keep full-backup behavior, CreateTS/DropTS, GC/visibility decisions, required-file errors and archive/index formats unchanged. The production change is confined to LoadCheckpointEntriesFromKey.

Add a real checkpoint writer/reader regression covering data/tombstone and appendable/immutable objects, full/consecutive-incremental selection, logical timestamp boundaries, unflushed objects and mandatory checkpoint files. It fails on the old predicate and passes with this fix.

Tested with:

  • Linux amd64, Go 1.27.1, controlled CGo build: complete pkg/vm/engine/tae/logtail and pkg/backup suites passed.
  • Isolated real TAE + MinIO: full plus three incrementals with insert/delete, merge and removal of merged-out source files. Unmodified mo-backup 84cb6f7 generated the index and restored four backup points with and without index lookup (8 successful restores), checking every manifest file's content, all typed rows and a fresh restart.
  • Full/incremental missing-required-source negative controls failed without publishing tae_list. A corrupted in-memory index canary was rejected by independent file checks.
  • The 4.2-dev companion validation also reproduces the original failure on its unpatched base and checks the captured incident checkpoint. main has a different downstream retention selector; identical end-to-end failure behavior is not assumed.

Limits: this requires a valid backup chain. Existing mo-backup false-success and dangling-index behavior is tracked separately in #32170 and #32171; this PR neither invents directory mappings nor repairs a damaged chain. No production deployment or mutation was performed.

@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 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: 3c61f5c6098c89914c6fbdf295c998f1d7906d98

Review completed. Read the assessment.

@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.

mo-bot review · mo-bot-local · review

Commit: 3c61f5c6098c89914c6fbdf295c998f1d7906d98

Assessment: approve

Immutable payload reuse now follows creation time while appendable flush handling and visibility metadata remain intact. The narrow correction reuses the existing backup-chain protocol; no actionable defects found.

Model: gpt-6.1-sol / max

Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0

Validation:

  • Reviewed the complete delta, both discussion entries and linked issues #32169–#32171; traced checkpoint readers, backup selection/copy/manifest, data-sync and GC consumers.

  • Reused supplied exact-head CI: Ubuntu/x86 UT, Linux/arm64 SCA, UT coverage and two multi-CN BVT configurations succeeded. Overall: 13 successful, 14 skipped and 2 neutral completed checks.

  • Reviewed the real-checkpoint regression and existing skipped-source/missing-required-source test oracles. The author additionally reports owning-package suites and eight indexed/non-indexed restores.

  • Local read-only audit passed: frozen head, clean source, matching delta, diff whitespace, gofmt and complete discussion coverage. Receipt: checks/1793853085924279663-2.json; retained log: source-audit.log.

Limitations:

  • No fresh local Go or TAE/MinIO/mo-backup execution; author execution reports and CI were reused, with raw runtime logs unavailable in the supplied evidence.

  • Reuse requires a valid backup chain. Separate preexisting mo-backup index issues #32170/#32171 remain outside this correction.

@mergify mergify Bot added the queued label Nov 5, 2026
@mergify

mergify Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

❌ Left the queue · Matrixone CI execution / UT Test on Ubuntu/x86 fails with this pull request

2 h 20 min in the queue, with no time running CI.

So far

  • ✅ Entered the queue Thu 5 Nov, 04:33 · rule main · triggered by rule Automatic queue on approval for main
  • ❌ Checks failed · in place
  • 🚫 Left the queue 06:52 · cda114f

The failure is in this pull request. It failed tested alone on top of main.

Reason

The merge conditions cannot be satisfied due to failing checks

  • CI Required

Failing checks:

To get back in the queue

  • Push a fix: the pull request is queued again once its queue conditions match.
  • If the failure is a flake, tick the box below to queue it again as it is.

Merge conditions not met when it left the queue

  • any of · required by GitHub branch protection:
    • check-neutral = CI Required
    • check-skipped = CI Required
    • check-success = CI Required

Requeue requested — the merge queue status continues in this comment ↓.

2 merge conditions met
  • #review-threads-unresolved = 0 · required by GitHub branch protection
  • github-review-approved · required by GitHub branch protection

Times in UTC · dashboard · how the merge queue works

@CLAassistant

CLAassistant commented Nov 5, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@mergify

mergify Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🚫 Left the queue · pull request dequeued

1 h 24 min in the queue, with no time running CI.

So far

  • ✅ Entered the queue Thu 5 Nov, 11:22 · rule main · triggered by rule Automatic queue on approval for main
  • ⏹️ Testing stopped · in place
  • 🚫 Left the queue 12:46 · 027c0ff

Reason

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

To get back in the queue

  • Push a change if one is needed: the pull request is queued again once its queue conditions match.
  • If no change is needed, tick the box below to queue it again as it is.

Merge conditions not met when it left the queue

  • any of · required by GitHub branch protection:
    • check-neutral = CI Required
    • check-skipped = CI Required
    • check-success = CI Required

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

  • Requeue this pull request
2 merge conditions met
  • #review-threads-unresolved = 0 · required by GitHub branch protection
  • github-review-approved · required by GitHub branch protection

Times in UTC · dashboard · how the merge queue works

This branch had an error being deployed

1 failed deployment
ci — 027c0ff3 Deployed Nov 5, 2026 by mergify[bot]
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/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Incremental backup recopies old immutable objects after deletion and fails on GC-removed sources

4 participants