Skip to content

fix(backup): reuse immutable objects across incremental backups (4.2-dev) - #32173

Merged
LeftHandCold merged 2 commits into
matrixorigin:4.2-devfrom
LeftHandCold:fix/backup-immutable-incremental-42-20261104
Nov 6, 2026
Merged

LeftHandCold merged 2 commits into
matrixorigin:4.2-devfrom
LeftHandCold:fix/backup-immutable-incremental-42-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:

Apply the same narrow immutable-object incremental-copy correction to 4.2-dev: a later DeleteTS does not require copying an already-backed-up immutable file again. Retain appendable flush/drop selection, full backups, GC/visibility semantics, required-source errors and all archive/index formats. Adapt the regression to this branch's existing checkpoint-loader API; do not replace its retention/owner logic with main's implementation.

Tested with:

  • Linux amd64, Go 1.26.4, controlled CGo build: complete pkg/vm/engine/tae/logtail and pkg/backup suites passed in the final run.
  • Real checkpoint decision matrix fails on a3cfb7551431d7e9d87c33383fb13c44e3757873 and passes with the fix.
  • Isolated real TAE + MinIO full/three-incremental sequence: the unpatched base fails after merged-out source files are removed; the fix succeeds. Unmodified mo-backup 84cb6f7 index generation and indexed/non-indexed restores passed at all four backup points (8 restores), with physical-file/content checks, typed-row comparison and restart.
  • Direct decoding of the captured incident checkpoint confirms unchanged creation/deletion metadata and NeedCopy=false for the exact previously misclassified object.
  • Missing required source files still fail full/incremental backup before manifest publication; an intentionally wrong in-memory index is detected by the independent restore checker.

Validation note: one earlier package run stalled in TestBackupData2 during checkpoint sync-table-id, before copy selection; it was stopped with a stack dump. Clean-base isolated/pair runs and the final patched complete package run passed. This PR does not claim to have diagnosed or eliminated that intermittent stall.

Limits: valid historical backup files remain required. Pre-existing mo-backup missing-file false success and dangling-index publication are separately tracked in #32170 and #32171. 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 4, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: 7e72ccc393b61419ecaefea2092d141f4e4e7743

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: 7e72ccc393b61419ecaefea2092d141f4e4e7743

Assessment: approve

The existing NeedCopy owner now reuses older immutable files while preserving appendable flush/drop selection, full backups and visibility metadata. The fix adds no state or format changes; downstream retention and required-source errors remain intact. No actionable findings remain.

Model: gpt-6.1-sol / max

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

Validation:

  • The checkpoint regression passes on the candidate. The original-predicate control fails only the incremental case; full/next-incremental controls pass.

  • Go 1.26.4: complete logtail and backup suites passed—112 top-level tests, no skips. Both packages passed build and vet checks.

  • Preflight, native provenance, frozen-source/patch identity and discussion coverage passed. validation-ledger.json reconciles all 13 receipts and retained logs.

  • Supplied exact-head CI reports 13 successful, 13 skipped and 2 neutral checks.

Limitations:

  • External MinIO/mo-backup eight-restore validation and incident decoding remain author-reported. Valid historical backup files remain required.

@XuPeng-SH

XuPeng-SH commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: 118376c1b4e167a258221f2cc6ae1229bd673e65

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: 118376c1b4e167a258221f2cc6ae1229bd673e65

Assessment: approve

The fix reuses the existing backup-chain mechanism for older immutable objects while preserving appendable, full-backup, retention and required-source error behavior. No actionable defects remain.

Model: gpt-6.1-sol / max

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

Validation:

  • Reviewed the complete two-file delta, all four discussion entries, three linked issues and affected consumers.

  • Supplied current-head CI reports 13 successful checks, including UT, SCA, build, coverage and multi-CN BVT; 13 skipped and two neutral checks were not counted as passes.

  • Prior review reports checkpoint regression/negative-control checks and 112 tests at parent 7e72ccc. Relevant source and tests are unchanged; merged dependencies prevent treating those results as fresh head execution.

  • Static source/evidence audit passed. source-audit.log and checks/1793879065629675445-2.json retain the matching command, source fingerprint and exit 0.

Limitations:

  • No fresh local Go/CGo or restore execution. Prior test results and author-reported eight restores lack raw logs in the supplied evidence.

  • The earlier TestBackupData2 checkpoint-sync stall remains undiagnosed; this change is not claimed to fix it.

This branch was previously deployed

1 inactive deployment
ci — 118376c1 Deployed Nov 5, 2026 by LeftHandCold
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