Lock wait timeout exceeded during cutover

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

维护者通常 10 天内回复

还没有人认领这个 Issue。

评估

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

调研方向

首先,使用提供的 gh-ost 命令和 MySQL 锁设置复现报告中的 cut-over,然后跟踪日志中显示的 cut-over 序列,包括被阻塞的 RENAME 和 magic-table 删除操作。完成的标准是确定为什么在没有可见事务的情况下仍会发生锁等待超时,并通过经过验证的复现记录或修正该故障。

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

描述

Azure Single Server.
MySQL verison 8.0.24
Ghost Version - gh-ost-1.1.4-1.x86_64.rpm

ghost command:

gh-ost
--assume-rbr
--allow-on-master
--azure
--max-load=Threads_running=10
--critical-load=Threads_running=50
--critical-load-interval-millis=10000
--critical-load-hibernate-seconds=100
--chunk-size=1000
--user="$user@$master"
--password="$pass"
--ssl
--assume-master-host=$master
--database="$database"
--table="test_summary"
--verbose
--host=$master
--alter="drop index index_secure_account_id_created,add index index_secure_account_id(secure_account_id)"
--cut-over=default
--default-retries=120
--panic-flag-file=/tmp/ghost.panic.flag
--initially-drop-ghost-table
--initially-drop-old-table
--exact-rowcount
--cut-over-lock-timeout-seconds=10 \ -- Also tried max 31536000
--hooks-path=/root/ghost_hooks/
--postpone-cut-over-flag-file=/tmp/ghost.postpone.flag
--execute

error log

Copy: 1559201/1559201 100.0%; Applied: 9; Backlog: 0/1000; Time: 14m22s(total), 5m36s(copy); streamer: mysql-bin.000039:96604335; Lag: 0.06s, HeartbeatLag: 0.10s, State: migrating; ETA: due
2024-01-06 19:59:38 INFO Setting RENAME timeout as 10 seconds
2024-01-06 19:59:38 INFO Session renaming tables is 713699
2024-01-06 19:59:38 INFO Issuing and expecting this to block: rename /* gh-ost */ table testdb.test_summary to testdb._test_summary_del, testdb._test_summary_gho to testdb.test_summary
2024-01-06 19:59:38 INFO Found atomic RENAME to be blocking, as expected. Double checking the lock is still in place (though I don't strictly have to)
2024-01-06 19:59:38 INFO Checking session lock: gh-ost.713695.lock
2024-01-06 19:59:38 INFO Connection holding lock on original table still exists
2024-01-06 19:59:38 INFO Will now proceed to drop magic table and unlock tables
2024-01-06 19:59:38 INFO Dropping magic cut-over table
Copy: 1559201/1559201 100.0%; Applied: 9; Backlog: 0/1000; Time: 14m25s(total), 5m36s(copy); streamer: mysql-bin.000039:96622242; Lag: 0.07s, HeartbeatLag: 0.08s, State: migrating; ETA: due
Copy: 1559201/1559201 100.0%; Applied: 9; Backlog: 0/1000; Time: 14m30s(total), 5m36s(copy); streamer: mysql-bin.000039:96645621; Lag: 0.07s, HeartbeatLag: 0.08s, State: migrating; ETA: due
2024-01-06 19:59:48 ERROR Error 1205: Lock wait timeout exceeded; try restarting transaction
Copy: 1559201/1559201 100.0%; Applied: 9; Backlog: 0/1000; Time: 14m35s(total), 5m36s(copy); streamer: mysql-bin.000039:96668998; Lag: 0.07s, HeartbeatLag: 0.08s, State: migrating; ETA: due
Copy: 1559201/1559201 100.0%; Applied: 9; Backlog: 0/1000; Time: 14m40s(total), 5m36s(copy); streamer: mysql-bin.000039:96692371; Lag: 0.07s, HeartbeatLag: 0.08s, State: migrating; ETA: due
2024-01-06 19:59:58 ERROR Error 1205: Lock wait timeout exceeded; try restarting transaction
2024-01-06 19:59:58 INFO Releasing lock from testdb.test_summary, testdb._test_summary_del
2024-01-06 19:59:58 INFO Tables unlocked
2024-01-06 19:59:58 ERROR Error 1205: Lock wait timeout exceeded; try restarting transaction
2024-01-06 19:59:59 INFO executing gh-ost-on-begin-postponed hook: /root/ghost_hooks/gh-ost-on-begin-postponed-hook
Mail Delivery Status Report will be mailed to .

Copy: 1559201/1559201 100.0%; Applied: 9; Backlog: 0/1000; Time: 14m45s(total), 5m36s(copy); streamer: mysql-bin.000039:96715743; Lag: 0.07s, HeartbeatLag: 0.08s, State: postponing cut-over; ETA: due

| innodb_lock_wait_timeout | 50 |
| innodb_old_blocks_pct | 37 |
| innodb_old_blocks_time | 1000 |
| innodb_print_all_deadlocks | OFF |
| innodb_status_output_locks | OFF |
| innodb_table_locks | ON |
| key_cache_block_size | 1024 |
| lock_wait_timeout | 31536000 |

unable to cutover, see no locks in db from innodb.trx . This seems like a bug.Can you please suggest next steps.

主要语言
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 摘要。