Skip to content

[Bug]: mo-backup publishes a current-directory index entry for a file that was not copied #32171

Closed

Description

@LeftHandCold

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.

Index producer.

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

  1. Create a full backup containing file F.
  2. Make the old file index absent/unreadable, retaining the actual full-backup files.
  3. Supply a subsequent incremental manifest with F marked NeedCopy=false, and no F in the current incremental directory.
  4. Call UpdateFileIndexAfterBackup.
  5. 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

  1. added
    kind/bug
    on Nov 4, 2026
  2. added
    severity/s0
    and removed on Nov 5, 2026
  3. LeftHandCold commented on Nov 5, 2026

    @LeftHandCold
    CollaboratorAuthor

    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.

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

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions