Locked tables at the final stage with FATAL critical-load met

未关闭
#1,596 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 10 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
go, mysql
领域
databases

调研方向

未指定源文件或测试。首先使用 critical-load 和 cut-over 设置复现命令的最终阶段序列,然后跟踪记录的 critical-load met 事件如何处理锁和进程退出。完成内容应包括对 cut-over 期间 critical-load 峰值的已记录或已测试行为,以及一种验证恢复或完成的方法。

由索引模型根据 Issue 内容生成。

描述

command:

gh-ost \
  --max-load=Threads_running=300,Threads_connected=600 \
  --critical-load=Threads_running=1000,Threads_connected=1000 \
  --chunk-size=20000 \
  --max-lag-millis=5000 \
  --dml-batch-size=200 \
  --user="root" \
  --password="SECRET" \ 
  --host=127.0.0.1 \ 
  --port=3306 \ 
  --throttle-control-replicas=127.0.0.1:3307 \
  --port=3306 \
  --gcp \
  --allow-on-master \
  --database="db" \
  --table="users" \
  --verbose \
  --switch-to-rbr \
  --allow-master-master \
  --cut-over=default \
  --exact-rowcount \
  --concurrent-rowcount \
  --default-retries=120 \
  --panic-flag-file=/tmp/ghost.panic.flag \
  --postpone-cut-over-flag-file=/tmp/ghost.postpone.flag \
  --alter="MODIFY name VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL"
  --execute

The command was successfully executed, and all that remained was to perform a cut-over to replace the tables.

2025-10-20 08:59:28 INFO Locking `db`.`users`, `db`.`_users_del`
Copy: 4025114/4025114 100.0%; Applied: 35738; Backlog: 44/1000; Time: 14m36s(total), 12m31s(copy); streamer: mysql-bin.3335455:24883896; Lag: 0.33s, HeartbeatLag: 0.25s, State: migrating; ETA: due
2025-10-20 08:59:28 INFO Copy: 4025114/4025114 100.0%; Applied: 35738; Backlog: 44/1000; Time: 14m36s(total), 12m31s(copy); streamer: mysql-bin.3335455:24883896; Lag: 0.33s, HeartbeatLag: 0.25s, State: migrating; ETA: due []
Copy: 4025114/4025114 100.0%; Applied: 35738; Backlog: 0/1000; Time: 14m37s(total), 12m31s(copy); streamer: mysql-bin.3335455:27128516; Lag: 0.47s, HeartbeatLag: 0.52s, State: migrating; ETA: due
2025-10-20 08:59:29 INFO Copy: 4025114/4025114 100.0%; Applied: 35738; Backlog: 0/1000; Time: 14m37s(total), 12m31s(copy); streamer: mysql-bin.3335455:27128516; Lag: 0.47s, HeartbeatLag: 0.52s, State: migrating; ETA: due []
2025-10-20 08:59:29 FATAL critical-load met: Threads_connected=1019, >=1000

However, at that moment, critical_load jumped to its limit values and the process was interrupted with an error (FATAL).
The lock seemed to hang for 1-2 minutes, and a spike was visible on the dashboard at that moment.
The worst thing is that it is impossible to restore the process...
Perhaps it is not necessary to fail immediately, but rather allow the value to be raised through the socket to complete the execution?
Or you have a better idea how to prevent such cutoffs at the end?

主要语言
Go
星标
13.6k
派生
1.4k
平均合并
9 天 19 小时
30 天内合并 PR
1

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/gh-ost 的其他 Issue

查看 github/gh-ost 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。