Repository navigation
Description
Is there an existing issue for the same bug?
- I have checked the existing issues.
Searched open/closed MatrixOne and mo-backup issues for UpdateFileIndexAfterBackup, backup dangling index, and index restore; no matching report found. Discovered during #32169 validation; separate from the immutable-object copy decision.
Branch Name
mo-backup main.
Commit ID
matrixorigin/mo-backup@84cb6f797cbfda622258a96f5bd629ce566d24f4.
Other Environment Information
Incremental backup with a valid historical physical file, but missing, unreadable or incomplete prior file index. Code-path analysis; the malformed-index restore consequence was reproduced independently, but this producer failure has not been injected into a production run.
Actual Behavior
UpdateFileIndexAfterBackup continues with a new empty index when loading the old index fails. For a tae_list entry with NeedCopy=false that is absent from that index, it nevertheless adds an entry pointing to the current backup directory, without copying or locating the physical file.
The current directory normally has no file for such an entry. This publishes a dangling lookup even though an older backup may still contain the file. postBackup also treats index update errors as non-fatal warnings after writing backup metadata.
Expected Behavior
An index entry must identify a directory containing the validated file. Missing old index state must not fabricate a current-directory location. Rebuild/resolve from actual backup contents or report a clear failure/degraded state before advertising valid index metadata.
Steps to Reproduce
- Create a full backup containing file F.
- Make the old file index absent/unreadable, retaining the actual full-backup files.
- Supply a subsequent incremental manifest with F marked
NeedCopy=false, and no F in the current incremental directory. - Call
UpdateFileIndexAfterBackup. - Its explicit fallback branch adds F with the current backup ID instead of locating its historical copy.
Additional information
This is a confirmed reachable code path, not a claim that the index was lost in the reported production incident. A minimal follow-up test should assert that every emitted index entry resolves physically, including missing/corrupt-index cases. The narrow MO kernel fix does not change this tool code or the index format.
Activity
LeftHandCold commentedon Nov 5, 2026
Fix submitted for review: https://github.com/matrixorigin/mo-backup/pull/85 (main, 60c30b4ff0ede28941f83a53fb35e051e7ab02b5). An unavailable prior index or unresolved uncopied file now prevents new index publication instead of fabricating a current-directory location. Existing valid archive metadata is retained with an explicit degraded-index warning. Validated on the requested test host with missing/partial/corrupt/access-denied index injection, unchanged historical bytes, physical index-reference checks, and real full/incremental restore/restart chains. Tests cover duplicate physical copies across backup directories. Existing full-package baseline failures are documented in the PR; no production deployment performed.
fix(backup): reuse immutable objects across incremental backups (#32172)
fix(backup): reuse immutable objects across incremental backups (4.2-…