Skip to content

[Subtask]: D21 [4.2-to-main] Simplify operator steps for 4.2-to-main upgrades with preflight and resumable migration #32298

Description

@XuPeng-SH

Parent Issue

Parent issue: #32278

Detail of Subtask

Catalog ID: D21
Origin: A - Introduced by 4.2-to-main evolution or incomplete retirement on main
Evidence level: Added operational burden confirmed in source/documentation; workflow optimization

4.2 versus main: provenance

Main adds legacy-CDC migration rejection, ambiguous snapshot-ownership decisions, and a 4.2-to-main upgrade guide absent from the baseline workflow. Coordinate with #31490's catalog migration work; this subtask focuses on operator steps and intermediate state.

Design problem, impact, and existing responsibility

Paused/failed legacy CDC tasks also block upgrade, requiring export/deletion of tasks and watermarks before upgrade and reconstruction afterward. Some snapshot decisions require exact UUIDs/NDJSON on shared storage. Refusing to guess identity is necessary, but discovering requirements only at startup and making users assemble internal state increases recovery cost and failure opportunities.

Acceptance criteria

  • Pre-upgrade checks identify affected tasks/snapshots and accurate actions; necessary decisions support bulk export/validation and idempotent execution.
  • Validate supported stopped upgrades, old-backup restore, interrupted migration/retry, and large catalogs; avoid discovering impossible requirements only after partial mutation.
  • Provide the shortest executable operator steps, cost, and recovery boundaries. Remove superseded intermediate stages/compatibility branches without requiring users to understand internal state machines.

Describe implementation you've considered

Reuse existing upgrade/restore ownership to move non-mutating checks, bulk export/validation, necessary decisions, and resumable progress before disruptive steps. Evaluate verifiable migration or explicit reinitialization. Preserve clear rejection where identity cannot be established, without adding another permanent repair workflow.

Additional information

Existing investigation and validation limits

service_upgrade_cdc.go, service_upgrade_snapshot.go, and the upgrade-4.2-to-main guide are additions relative to the baseline. No claim is made that every old CDC definition can migrate losslessly or that necessary human decisions should be replaced by guessed metadata.

main investigation snapshot: pkg/bootstrap/service_upgrade_cdc.go:29; pkg/bootstrap/service_upgrade_snapshot.go:189; docs/guides/upgrade-4.2-to-main.md:1

4.2 baseline snapshot: pkg/bootstrap/service_upgrade.go

The named probes are local diagnostic overlays, not committed repository tests. Their names identify the investigation; they cannot be selected directly from an ordinary checkout. Implement the smallest maintained contract regressions and reuse relevant CI/validation proportionally. Temporary evidence commits are not required.

Related existing work: #31490, #27967. Closed items identify implemented controls or historical context; they do not mean this subtask is already resolved.

Activity

  1. self-assigned this
    on Nov 5, 2026
  2. added theissue type on Nov 5, 2026
  3. changed the title [-][Subtask]: D21 [4.2→main] 简化 4.2→main 升级的人工中间过程,提供前置预检与可恢复迁移[/-] [+][Subtask]: D21 [4.2-to-main] Simplify operator steps for 4.2-to-main upgrades with preflight and resumable migration[/+] on Nov 5, 2026
  4. MatrixAdventurer commented on Nov 6, 2026

    @MatrixAdventurer
    Contributor

    分级建议:severity/s-1——父单 #32278 的升级运维负担类子任务,正文未见数据错误或集群故障证据,属可排期优化。
    所属模块:4.2→main 升级链路(升级运维步骤/预检)。
    疑似重复:未发现;同链路已知故障 #27967(open/s0)、#29396(closed)仅作参考。
    建议负责人:XuPeng-SH(父单发起人、本子任务 assignee)。
    本操作由LW授权的MOI智能体提交

  5. added a commit that references this issue on Nov 6, 2026
    606ae4f
  6. XuPeng-SH commented on Nov 6, 2026

    @XuPeng-SH
    ContributorAuthor

    QA handoff for #32307, merged into main as 606ae4fb2a94890709a2d573aaee936a27442dc3 on 2026-11-06. This is a product upgrade subtask; it remains open for QA rather than being closed as CI flaky. This handoff is not acceptance.

    Delivered scope
    A read-only 4.2 preflight inventories CDC tasks and ambiguous snapshot ownership before upgrade. It reuses the existing decision export/validation/publication path, requires explicit administrator decisions and exact-preimage checks, and preserves rejection where safe CDC resumption or identity cannot be established. Signal cancellation joins the tracked direct child, including launch-to-PID-registration; an atomic publication that wins remains a complete file. Snapshot catalog reads use pages of 32 for legal wide names within the 4 MiB result cap; decision-write/diagnostic batches remain 128.

    The complete issue history contains one triage comment, with no further implementation request. Returned PR discussion reports no current counterexample or unfinished explicit follow-up for the delivered subtask. Parent #32278 and separate #29433 are not completed by this handoff.

    Evidence and limits
    Validation reported by the author is separate from this handoff. After rebasing on bfbb2645c034, the author reports bootstrap/sysview race runs (84/43 top-level tests), focused stale/missing/failed PARTITIONS and admission checks, a real-catalog predecessor-definition reconciliation, and a rebuilt released-4.2.5 single-CN/two-tenant stopped upgrade plus clean restart. Earlier broader suites, 4.2.8 upgrade/snapshot results and 4,382-pass BVT evidence are historical, not fresh final-head reruns. Review 5807211198 covers df8de7376c21435679b4d1e6fc87e11726ef1e7a and reports 11 exporter tests/static audits while reusing author runtime reports; it did not independently run Go, cluster-upgrade or BVT, and raw author logs were unavailable. Final recorded PR head is cc890a2341a99791a2034bd26a5f562d3969936d; five CI jobs were incomplete at that review. No new final-head runtime or CI pass is claimed here.

    Earlier author reports include 11 preflight tests, deterministic cancellation and 20 signal repetitions, released-4.2.8 historical-snapshot/129-wide-snapshot upgrade/recovery/restart, plus Bash/ShellCheck/Ruff checks. These are not this handoff's executions or fresh final-head passes. No tests were run here; the headerless patch does not provide an independently enumerated 66-file audit.

    QA boundaries
    Exercise inventory/export/validation, explicit decisions and preimage mismatch, interrupted/retried publication, cancellation before/after child registration and publication, wide snapshot names, and stopped upgrade/restart with retained data. Confirm invalid CDC restore requirements reject before mutation. System-account and cluster snapshot/PITR restores with incompatible old CDC watermark schema remain deliberately rejected, not losslessly migrated. Preflight needs a MySQL-compatible client, jq, GNU coreutils, proportional scratch disk, and drained source snapshot/branch writers. Smaller pages can cause roughly four times as many one-time page reads and do not bound total engine memory. Real release multi-CN, production-scale resource cost, mixed-version and downgrade behavior are not validated/supported by this change.

    Handing to @Ariznawlll for scoped QA.

  7. Ariznawlll commented on Nov 10, 2026

    @Ariznawlll
    Collaborator

    结论

    测试通过。

    关键证据

    • 基于官方 main 00da05219fb8dce0266de4efa7c4bbfac06491de,使用官方 4.2.5 发布包,在隔离 Linux 环境执行停机升级。旧版创建真实运行中的 CDC 任务后,预检识别出 1 个任务;main 启动时拒绝升级并提示任务名与状态。恢复升级前的 4.2.5 数据副本后,确认原任务仍存在。真实 CDC 验证
    • 在相同 main 版本上,从 4.2.5 创建带分支式命名的用户快照,预检导出待决记录;未填写决策被拒绝,指定 user 后升级、重启以及从旧备份恢复再升级均保留用户快照。校验 131 个租户数据。快照决策回归
    • 同一版本覆盖 131 个租户、129 个长名称快照以及两个 CN;观察到非系统租户版本更新后中断承载 CN、TN 和 LogService 的进程,重启并校验数据与快照,再恢复升级前数据副本并重新升级。中断恢复回归
    • 基于前一个 main 0c8bd5e5f3be4ce5582201513161181ddca37d6d,CDC 准入、快照分页、无效或过期决策及事务边界使用现有白盒测试执行 -race -count=3 并通过。白盒测试;0c8bd5e 与 00da052 之间升级相关目录无变更。
    • 已加入 nightly 回归 PR #1919,合入后在 main 每日执行;本次未向主库提交测试 PR。

    待解决点

    • 双 CN 在单台隔离主机运行;本次没有验证独立物理节点、所有中断时点、真实分支边快照、CDC 下游和水位迁移。旧 CDC 必须按升级指南在源版本导出、移除,升级后重建;白盒决策边界不能替代以上专项。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions