Repository navigation
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: 7b97786b67ea72222f792ea258a6ab914a107cad
结论:本轮代码审查未发现需要阻断合并的问题(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。
分支复核:与 #30743 的生产修复一致,4.2 原有 retained-history/GC 过滤和重复备份测试保留;未发现依赖 main 独有 API 或恢复行为的回移问题。备份包最终 normal/race 原始日志各有 65 项顶层测试通过。
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 7b97786b67ea72222f792ea258a6ab914a107cad
Assessment: approve
Reviewed the complete five-file delta and its backup, checkpoint, replay and GC callers. The design restores history continuity through existing owners and metadata, preserves the GCKP guard, and handles publication cleanup conservatively. No actionable defects found. Added work is confined to backup index copying, checksumming and merging; ordinary SQL paths are unchanged.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
Validation:
-
Reviewed regressions for separate-WAL restore, immediate GCKP, durable 24-hour history, manifest checksums, subsequent writes and restart, exact predecessor boundaries, legacy history, repeated archives and cleanup failures.
-
Reused the supplied exact-head successful build, Ubuntu UT/coverage, Linux arm64 SCA and compose BVT results. Inspected repository test selection; the relevant backup tests have no short-mode exclusion.
-
Source identity and changed-file audit passed: review-source-audit.log matches checks/1792580185090193392-4.json.
-
git diff --check passed: review-diff-check.log matches checks/1792580189597774455-3.json. Both receipts record the assigned head, clean source and exit code 0.
Limitations:
-
No local native tests were rerun. local_validation is empty; author-reported raw logs and repetition counts were not independently available.
-
No large-backup performance measurement, external mo-backup-image test or mixed-version rollout validation was supplied. Full repair requires updated CN and TN components and cannot recover history already missing from older archives.
-
Issue #30738 was assessed through the supplied PR description; its standalone issue body was not included.
XuPeng-SH
left a comment
There was a problem hiding this comment.
独立深度评审 head 7b97786b67ea72222f792ea258a6ab914a107cad,base/merge-base 为 4.2-dev@7eba89b210cb5c0f8b5d1102ad450084b65c9c88。本轮未发现需要阻断合并的问题,Approve。
设计及功能闭环已检查:真实备份入口、精确 predecessor 选择、ICKP/GCKP 边界、索引实体复制与 checksum、special checkpoint 重写、元数据发布、独立 WAL 恢复、GCKP、后续写入和重启。修复复用现有 SyncTableIDBatchWithHistory / TableIDLocation / 清理机制,没有新增状态机、磁盘列或放宽历史完整性校验。4.2 分支已有的历史对象保留与连续备份行为保留。
失败路径已核对:源对象缺失、目标同名不同内容、Stat/Read/Delete 失败、重复 location,以及发布前/发布结果不确定时的清理所有权。旧空索引保持部分历史,真实历史缺口继续 fail-closed。当前无行级 review threads;已有评审中的适用范围限制仍成立。
本轮重新执行的本地验证(Darwin/arm64,Go 1.26.4,按当前源码重新构建 CGo):
- pkg/backup 全部 65 项顶层测试 normal/race 通过;checkpoint、logtail 全包 normal/race 通过。
- 生产所属包 build/vet 和 diff --check 通过。
- 独立 WAL 恢复回归连续 17 次 race;索引边界/复制和失败清理用例各 100 次 race;原 TestBackupData3/4 分别 25/24 次;4.2 原有连续归档回归 32 次,全部通过。
- 独立 review overlay 将历史窗口改为 72 小时并使用 ICKP 备份边界,实际备份→新 WAL 恢复→立即 GCKP→写入/删除→再次重启,连续 15 次 race 通过。
- 将三个生产修改文件替换为精确 merge-base 版本的负向对照,在真实恢复后的 GCKP 上复现
global checkpoint table-ID history is incomplete。原有真实缺口 fail-closed 用例 normal/race 均通过。
分别审视了增量:实现 +197/-10,测试 +450/-2,文档 0。测试覆盖实际恢复和持久化结果,组件 fault 用例与集成用例职责不同。新增开销位于备份时的历史索引扫描、复制和合并,普通 SQL/TP 路径没有新增逐行工作;未做大规模备份性能基准。
边界:此修复不补回旧归档已缺失的历史;CN/TN 两端需包含对应改动。本轮验证为本地备份库/引擎链路,未运行外部 mo-backup 镜像或客户集群。没有使用 subagent。
…#31886) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Related to #28473 and #30738 on `release/v4.2.1-hotfix-20261026`. Backports #29504 and #30744. This PR does not claim to recover previously missing source objects or repair already incomplete backup archives. ## What this PR does / why we need it: Cherry-pick the two final, merged `4.2-dev` fixes onto the hotfix base `3391c6844e95d1bb27a647b18f48f7c3a5ba1695`, preserving them as separate commits: | Upstream PR | Upstream commit | Hotfix commit | Purpose | | --- | --- | --- | --- | | #29504 | `6d4569bce66acb67e6d0fe746ee537da7955bffd` | `2bf7df8892748f7ff8fe160641b52a7acaa70d9e` | Safely omit reclaimed historical objects without dropping required snapshot/shared-owner data | | #30744 | `b7d2cc7b5644641da580dd5650a02211167a781d` | `969680122fdebccfacdb21b7c84f40b5204878b3` | Preserve real table-ID history across physical backup/restore so an immediate GCKP can validate its required history | Both cherry-picks are conflict-free and their stable patch IDs match upstream. No unrelated `4.2-dev` commits, hotfix-specific production changes, retention-policy changes or weakened GCKP checks are included. ### Backup object selection - Resolve object lifecycles before physical-file deduplication; retain other live owners, compacted references and restore-boundary objects. - Require an actual persisted GC scan interval before using absence from remaining objects to omit a deleted lifecycle. A GC filename is only a recovery watermark and can be advanced without scanning by `CopyGCDir`. - Keep the existing block-zero format and add an optional scan-proof block. Unknown legacy coverage stays conservative; incomplete reads and malformed proof fail rather than publishing a partial backup. ### Restore history - Copy and checksum the exact predecessor's real table-ID index before bulk data copying. Reuse matching destination bytes; reject mismatches without overwriting. - Merge retained history through the rewritten backup checkpoint, persist the index location, and include its files, sizes and checksums in the archive manifest. - Preserve the distinct global/incremental successor-boundary conventions. - On pre-publication failure, clean only newly generated, unambiguously unpublished destination index files. Do not delete source data or potentially published history files. ### Validation Performed on the combined hotfix head, Darwin/arm64 CPU, Go 1.26.4, with freshly built branch-matched native artifacts and the repository CGo wrapper: - Focused combined backup/GC/history regressions: PASS. - Full normal suites with `-vet=all`: `pkg/backup`, `pkg/vm/engine/tae/logtail`, `pkg/vm/engine/tae/db/gc/v3`, `pkg/vm/engine/tae/db/checkpoint`, `pkg/vm/engine/tae/db`, `pkg/objectio`, and `pkg/datasync`: PASS. - Full race suites: backup, logtail, GC v3, checkpoint, and DB: PASS. - `TestBackupRestoreGlobalCheckpointWithFreshWAL`: normal/race PASS, plus 19 consecutive race repetitions PASS. This exercises a separate restored WAL, immediate GCKP, durable 24-hour history coverage, archived checksums, LSN `4 -> 0 -> 1`, post-restore writes and complete row/value checks after another restart. - `TestGlobalCheckpointTableIDHistoryFallbackAndFailClosed`: normal/race PASS, plus 36 consecutive race repetitions PASS. Missing history still rejects GCKP, and repeated rejected attempts do not accumulate unreachable objects. - Historical snapshot retention, repeated backups with inherited GC watermarks, legacy metadata, scan gaps, owner/type/epoch boundaries, partial reads, cancellation, checksum mismatch and cleanup-failure cases: PASS in the owning suites. - Go-toolchain-matched `gofmt` and `git diff --check`: PASS. These are real engine/file-service integration and component tests, not an external mo-backup image, production-scale performance or production restore acceptance. No production environment was changed. ### Rollout boundaries - #29504 includes both CN backup selection and TN scan-proof production. Updating only the external backup tool cannot substitute for updating the relevant MO components. - Legacy metadata without trustworthy scan proof may still cause conservative backup failure. Upgrading cannot retroactively certify old scans or guarantee that one new GC cycle covers every old object. - #30744 preserves history in newly generated archives; an existing archive that already lacks that history is not repaired retroactively. - Source GC deletion/retention policy is unchanged. Extra metadata reads and backup-time history work exist; zero overhead or universal production recovery is not claimed. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: XuPeng-SH <[email protected]>
What type of PR is this?
Which issue(s) this PR fixes:
issue #30738
What this PR does / why we need it:
Backport the physical-backup table-ID history repair to
4.2-dev.The special backup checkpoint currently loses its predecessor's history index, and copying the checkpoint directory does not copy the root-level index objects. Consequently, a fresh physical restore can fail an immediate GCKP's normal 24-hour history check despite a complete source history.
The
4.2-dev-specific object-retention/GC-history implementation and its existing repeated-archive backup test are preserved, not replaced by the main implementation. The new component tests usebackup_table_id_history_test.goto avoid replacing the branch's existingbackup_history_test.go.No new disk-format column, shorter retention, fake coverage marker or relaxed GCKP guard. The backup checkpoint response stays five fields. Existing archives that already lack the required historical objects cannot be retroactively repaired by this patch and may still need actual history accumulation.
Tested with (CPU, Darwin/arm64, Go 1.26.4; repository CGo wrapper):
pkg/backupnormal and race suites, including the unchangedTestExecBackupPreservesHistoryAcrossInheritedGCWindowand its second-archive backup.TestGlobalCheckpointTableIDHistoryFallbackAndFailClosed, normal/race and 36 consecutive exact race repetitions.4 -> 0 -> 1, post-restore writes and a second restart's complete row/value checks.gofmtandgit diff --check.These are engine/backup-library tests, not an external mo-backup-image or production-cluster validation. No production configuration, objects or cluster lifecycle was changed.