Skip to content

[Bug] PITR Backup Restore Test checkpoint dump restore 挂起 12 小时无输出 #26526

Closed

Description

@Ariznawlll

环境

Field Value
分支 4.2-dev
Run https://github.com/matrixorigin/mo-nightly-regression/actions/runs/30579495362/job/91056897644
Job CHECKPOINT DUMP S3 WITH PITR DATA
Commit 6f85cb6d3c

问题

CHECKPOINT DUMP S3 WITH PITR DATA job 在 restore 阶段挂起 11 小时 44 分钟,无任何输出,最终手动 cancel。

时间线

02:26:05  verify_s3_checkpoint_dump_restore.sh 开始
02:26:12  Wait and list checkpoint databases
02:26:32  List checkpoint tables(38 张表,含 100M/1B 行大表)
02:26:46  Dump whole database to S3
03:10:09  Dump 完成(~43 分钟,含 42GB 数据)
03:10:09  Download and rewrite restore.sql from S3
03:10:10  Restore dump into target account ckps3pitr:test_account 开始
          ↓↓↓ 挂起 11 小时 44 分钟,无任何输出 ↓↓↓
14:54:03  手动 cancel

关键发现

  1. restore_target.log 为 0 字节 — restore 命令启动后完全没有输出
  2. Dump 阶段正常 — 38 张表(含 big_data_test 的 100M/1B 行表,总计 42GB)成功导出到 S3
  3. Orphan processes: cancel 时清理到 pid 387 (bash) 和 pid 681 (mysql),说明 mysql 客户端仍在运行
  4. 挂起原因: 可能是 restore.sql 中的 LOAD DATA 语句从 S3 加载大表数据时 MO 服务端 hang 住

附件

  • Artifact: checkpoint-dump-s3-pitr-result (ID: 8797229815)
  • 包含 databases.txt、tables.txt、restore_target.log(空)、database_dump.log

Activity

  1. added
    kind/bug
    on Jul 31, 2026
  2. changed the title [-][Bug] PITR Backup Restore Test 连续 10+ 天失败:checkpoint dump restore 挂起 12 小时无输出[/-] [+][Bug] PITR Backup Restore Test checkpoint dump restore 挂起 12 小时无输出[/+] on Jul 31, 2026
  3. added theissue type on Jul 31, 2026
  4. added this to the MO-202607 milestone on Jul 31, 2026
  5. Ariznawlll commented on Jul 31, 2026

    @Ariznawlll
    CollaboratorAuthor

    深入排查:根因是 Proxy → CN 认证 i/o timeout,mysql 客户端无限重试

    证据 1:CN 报 i/o timeout(关键)

    [03:11:15] CN gpxj4  frontend/mysql_protocol.go:3874
      cannot get salt, maybe not use proxy
      err=read tcp 10.143.169.208:6001->10.143.169.205:50204: i/o timeout
    

    CN 尝试从 Proxy (10.143.169.205) 读取 salt 时 i/o timeout。Proxy 没有在规定时间内返回认证数据。

    证据 2:Proxy 每 5 秒收到连接并立即丢失

    [03:11:25] INFO  new connection comes
    [03:11:25] ERROR close connection failed: use of closed network connection
    [03:11:30] INFO  new connection comes
    [03:11:30] ERROR close connection failed: use of closed network connection
    ... (每 5 秒重复,持续 12 小时)
    

    证据 3:Proxy Handshake 被 client reset

    [03:14:25] ERROR failed to handle Handshake response
      err=writeto tcp4: read: connection reset by peer
    

    证据 4:所有成功连接都是内部连接

    成功连接到 CN 的连接全部是 account sys:mo_logger(MO 内部监控),restore 客户端 (ckps3pitr:test_account) 从未成功连接。

    证据 5:CN 零查询执行

    03:10 ~ 14:54(12 小时)三个 CN 上 Exec.Run 日志为零,没有任何 SQL 被执行。

    证据 6:内存趋势佐证

    Pod 03:00 14:00 说明
    dn-0 16.8G 3.5G dump 完成后释放,稳定
    tp-cn-gpxj4 2.5G 4.1G 缓慢增长(内部任务,非 restore)
    proxy 0.2G 0.2G 稳定

    CN 内存增长是内部后台任务,不是 restore 数据处理。DN 稳定说明没有数据写入。

    完整故障链

    03:10:10  mysql_file 启动,mysql 客户端连接 Proxy (172.16.96.192:6001)
              ↓
              mysql → Proxy: TCP 连接建立 ✅
              Proxy → CN: 转发连接 ✅
              CN → Proxy: 请求 salt (认证数据)
              Proxy → CN: ❌ i/o timeout (Proxy 没有返回 salt)
              CN: "cannot get salt" → 关闭连接
              Proxy: "close connection failed"
              mysql: "connection reset by peer" → 5 秒后重试
              ↓
              无限循环 (每 5 秒重试一次,持续 12 小时)
              ↓
    14:54:03  手动 cancel
    

    可能原因

    1. Proxy 认证缓存未刷新 — ckps3pitr:test_account 刚刚通过 CREATE ACCOUNT 创建,Proxy 可能还没同步到该账户的认证信息
    2. Proxy 内部超时 — Proxy 在查找账户元数据时超时
    3. Proxy bug — Proxy 在 Handshake 阶段处理新创建的 account 时存在缺陷

    建议

    1. CREATE ACCOUNT 后加等待 — 在 create account 和 mysql_file 之间加 sleep 或轮询验证连接可用
    2. mysql 客户端加 --connect-timeout — 避免无限重试,让脚本能快速失败
    3. 排查 Proxy salt 传递超时 — 为什么 Proxy 无法在超时时间内返回 salt 给 CN
  6. XuPeng-SH commented on Jul 31, 2026

    @XuPeng-SH
    Contributor

    补充并更正前一条诊断:重新查询真实 CI Loki,并逐个核对归档的原始 goroutine snapshot 后,现场证据可以直接确认 restore 已认证、SQL 已执行,并且命中了 PR #26533 修复的 distributed-delete RemoteRun fallback。

    • 03:10:10.363181 UTC,目标 restore 连接已完成 Authenticate 并收到 OK;目标 session 没有 cannot get salt。此前引用的 salt timeout 属于其他连接,而且同类 timeout 在 restore 开始前已经出现。
    • 03:10:10.567937,planner 开始处理脱敏后的 LOAD DATA URL (...) ... PARALLEL=true。
    • 03:10:10.590517–.601298,statement 019fb626-984b-7eda-bb4f-aac9e7d65773、trace c8489d33-8079-91e3-8f0b-56321c81ac0d 产生 128 条 RemoteRun fallback 日志:64 个唯一 pipeline 各出现两次,原因明确为 dispatch 引用了当前 remote tree 之外的 local pipeline。
    • 03:13:18 原始 coordinator snapshot 中,目标 frontend goroutine 已在 executeStatusStmt -> Compile.Run -> runOnce 内;同一 compile execution 有 2 个 MergeDelete.Call、96 个 Deletion.remoteDelete,且 remote-delete 栈全部经过 Scope.RemoteRun -> Scope.MergeRun。Loki 中 64 个 fallback pipeline 指针与这些原始栈逐一匹配。
    • 同时形成严格闭合的 wait-for graph:coordinator 2048 个 notify/receive wait,两个 remote CN 各 1024 个 GetProcByUuid wait。14:50 snapshot 的数量和栈完全不变,已持续约 700 分钟。

    此前“Exec.Run 日志为零,所以没有 SQL 执行”的推断不成立:status_stmt.go 先调用 runner.Run(0),只有该调用返回后才输出 time of Exec.Run;本次调用正卡在上述执行栈中,因此该日志为零是预期结果。SQL 文本没有字面 DELETE 也不能排除物理 Node_DELETE,真实运行栈已经直接显示 MergeDelete/Deletion.remoteDelete。

    结论:认证问题不是这次 11h44m restore hang 的阻塞点;根因是 distributed delete scope 的执行位置被静默改到 coordinator 后,跨 CN dispatch UUID 的发布者与 FromAddr 不一致,receiver 永久等待。修复见 #26533。

  7. added a commit that references this issue on Aug 1, 2026
    a72b5a1
  8. XuPeng-SH commented on Aug 2, 2026

    @XuPeng-SH
    Contributor

    should be fixed

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

Metadata

Metadata

Assignees

Labels

kind/bug

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions