Lock wait timeout exceeded during cutover

オープン
#1,364 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 10 日以内に返信

まだ誰も着手していません。

評価

難易度
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時間
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

github/gh-ost のほかの issue

github/gh-ost の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。