Repository navigation
fix(backup): preserve table-ID history across physical restore - #30743
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
LeftHandCold
left a comment
There was a problem hiding this comment.
Reviewed head: 85c884617ba68869c89f32936a6b09fd64209d7c
结论:本轮代码审查未发现需要阻断合并的问题(code-review verdict: would approve)。这不是 CI 已通过或生产验收通过的声明。
重点复核:
- 修复落在现有备份/检查点职责内,复用 SyncTableIDBatchWithHistory 与既有 TableIDLocation;没有新增恢复状态机、磁盘列格式或绕过 GCKP 历史完整性校验。
- 精确区分 ICKP 的 inclusive end 与 GCKP 的 exclusive end,真实历史缺口仍然拒绝;旧索引文件和新生成索引都实际进入归档及带 checksum 的清单,不只是写一个引用。
- 检查了缺失文件、目标同名但内容不一致、Stat/Read/Delete 失败,以及元数据发布前后的清理所有权。未发现误删已被引用索引的新增路径。
- 恢复测试使用独立 WAL,校验恢复后立即 GCKP、后续写入/删除/ICKP、再次重启后的数据;没有用放宽历史窗口来掩盖问题。
- 新开销集中在备份时的历史索引读取、校验和复制,不在常规 SQL/事务热路径。本次未做大规模备份性能基准,不把静态分析表述成性能实测。
验证方式:核对并复用本地保存的测试原始日志、相关源文件指纹和修复前失败反例;本轮仅执行格式/diff 等轻量检查,没有重复启动重型构建或 UT。checkpoint/logtail normal/race 与真实缺口 fail-closed 测试的已有证据可复用。
适用边界(非 blocker):这修复的是修复版本生成的新备份,不能补出旧归档里已缺失的历史;完整修复需要 CN/TN 两端都包含对应改动,滚动升级混合版本阶段不应承诺该边界场景已完全修复。当前部分 Linux UT/BVT/coverage/SCA CI 仍在运行,按仓库合并规则等待即可。
当前登录账号与 PR 作者相同,GitHub 不允许自审 Approve,因此提交 COMMENT 记录代码结论,不冒充正式 approval。
分支复核:与 #30744 联合检查,main 当前 head 相对原已测修复仅合入 5 个无关 Python SDK 文件,备份/检查点闭包和构建输入未变。备份包最终 normal/race 原始日志各有 60 项顶层测试通过。
|
mo-bot review · Commit: Review completed. Read the assessment. |
Merge Queue Status
This pull request spent 37 minutes 52 seconds in the queue, with no time running CI. ReasonPull request #30743 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.
HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Waiting for any of
All conditions
Tick the box to put this pull request back in the merge queue (same as
|
What type of PR is this?
Which issue(s) this PR fixes:
issue #30738
What this PR does / why we need it:
Physical backup metadata currently gives its special checkpoint an empty table-ID index. The archive also omits the root-level objects referenced by the preceding checkpoint's index. After restore, the next ICKP therefore starts a partial history at the backup boundary; an immediate GCKP fails the existing 24-hour completeness check even when the source had complete history.
This change preserves the real history instead of bypassing that check:
4 -> 0 -> 1.No disk-format column, history-window reduction, fake coverage marker, restore-epoch exception, or GCKP guard relaxation is introduced. The five-field backup checkpoint response is unchanged.
Scope: this repairs newly generated backups made with the fixed backup path. It cannot retroactively recover history objects absent from an existing archive; such archives remain subject to the real coverage window. This is an engine/backup-library integration validation, not an execution of the external mo-backup image or a customer-cluster acceptance test.
Tested with (CPU, Darwin/arm64, Go 1.27.1; repository CGo wrapper):
pkg/backupnormal and race suites.pkg/vm/engine/tae/db/checkpointandpkg/vm/engine/tae/logtailnormal and race suites.TestGlobalCheckpointTableIDHistoryFallbackAndFailClosed, normal/race and 29 consecutive exact race repetitions.TestBackupRestoreGlobalCheckpointWithFreshWAL, normal/race and 20 consecutive exact race repetitions. The later legacy-selection cases are separately covered by the final complete normal/race Backup suites.gofmtandgit diff --check.The public SQL syntax/frontend are unchanged. The new integration fixture exercises the real physical-archive writer and the restore/checkpoint/restart consumer, which an ordinary SQL-only BVT cannot cover without owning a restore and a fresh WAL directory. No production resources were modified.