Skip to content

[Bug] Backup succeeds after silently omitting a checkpoint-listed object #26247

Closed

Description

@Ariznawlll

Summary

Backup object copying treats a missing source object as a successful skip. A checkpoint can list an object, the destination can receive no copy of that object, and the backup path still returns success.

Reproduction

  1. Give parallelCopyData one BackupObject whose location is listed by a checkpoint.
  2. Use a source file service that has no file at that location.
  3. Run the copy step.

The copy step returned nil and produced no destination object in 3/3 runs on 8c9bb66898afa74f8b231e1915d99489ae8a0da7.

Actual behavior

parallelCopyData catches ErrFileNotFound, increments an internal skip counter, and returns a successful job result. The missing object is absent from the returned file list, while execBackup continues to save backup metadata.

Expected behavior

A checkpoint-listed object that cannot be copied must fail the backup and prevent it from being reported as complete.

Impact

A completed backup can omit a data object referenced by its checkpoint. Restoring or reading that backup can then fail or produce an incomplete result.

Activity

  1. added this to the MO-202607 milestone on Jul 27, 2026
  2. added
    kind/bug
    on Jul 27, 2026
  3. added theissue type on Jul 27, 2026
  4. LeftHandCold commented on Jul 28, 2026

    @LeftHandCold
    Collaborator

    已在当前 main(6004becb56adc7f4d22dbfb9554bef8d7091e25d)确认根因:checkpoint 列出的对象属于备份一致性边界,但 parallelCopyData 遇到 ErrFileNotFound 时只增加 skipCount 并返回成功,execBackup 随后仍会保存缺少该对象的成功清单。这不是理论问题;源对象被并发 GC/不可见时会产出不可完整恢复的备份。

    修复 PR:#26290

    修复将所有对象复制错误(包括 ErrFileNotFound)返回给备份调用方;首错后停止接单、取消兄弟任务,并等待所有已提交任务退出。新增 missing object、停止 admission、等待已提交 sibling 的确定性回归;pkg/backup 完整 non-race/race、focused -race -count=100、build/vet 和 pkg/datasync.TestCopyFile 均通过。

  5. LeftHandCold commented on Jul 28, 2026

    @LeftHandCold
    Collaborator

    fixed

  6. added
    severity/s0
    and removed on Jul 28, 2026
  7. Ariznawlll commented on Aug 3, 2026

    @Ariznawlll
    CollaboratorAuthor

    测试版本

    • 分支:main
    • commit:6b3ad84c9d01d453c2bcdd0f440637350e3aa8c6
    • 测试日期:2026-08-02
    • 部署/验证方式:官方 main 源码构建;备份缺失对象路径使用 pkg/backup 的确定性故障注入,正常路径执行完整备份、重启、恢复和扫描校验。

    原问题验证

    原问题的关键是 checkpoint 已列出的对象在复制时不可读/不存在,不能被当作“可忽略文件”而让备份返回成功。本轮定向执行:

    go test ./pkg/backup -count=3 -run '^(TestParallelCopyDataReturnsMissingSourceObject|TestParallelCopyDataStopsAdmissionAfterFailure|TestParallelCopyDataWaitsForScheduledSiblingAfterFailure|...)$'
    

    连续 3 轮均通过。缺失源对象返回 file not found 错误,复制结果不作为成功清单返回;首个不可恢复错误后不再接纳后续任务,并等待已投递的 sibling 退出后才返回。

    Happy Path 覆盖

    1. TestCopyFileWithRetry 与成功 provider-copy 控制路径连续 3 轮通过。
    2. TestBackupData 连续 3 轮执行完整备份、服务重启、恢复及数据扫描,均通过(ok github.com/matrixorigin/matrixone/pkg/backup 5.286s)。

    Unhappy Path 覆盖

    1. checkpoint 列出的源对象缺失:返回错误,不静默跳过。
    2. 首个永久复制失败:停止向 worker admission 新任务。
    3. 失败时已有 sibling 正在执行:等待其退出,避免返回后遗留复制任务。

    白盒验证

    缺失 checkpoint 对象需要在对象存储读取处精确注入 ErrFileNotFound,普通 SQL/备份接口无法稳定制造该瞬时一致性边界,因此采用上述包内确定性故障注入。覆盖用例位于 pkg/backup/tae_parallel_copy_test.go。

    回归测试

    该问题依赖对象存储在 checkpoint 之后丢失对象的内部故障注入,适合保持为 pkg/backup 白盒回归,不作为普通 motr 黑盒 case。

    测试证据

    定向回归命令连续 3 轮结果为 ok github.com/matrixorigin/matrixone/pkg/backup 0.905s;完整备份/恢复控制连续 3 轮结果为 ok github.com/matrixorigin/matrixone/pkg/backup 5.286s。

    测试结论

    测试通过。

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

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions