File-position checkpoints can point inside a transaction, causing --resume to fail with a missing TABLE_MAP error
メンテナーはふだん 10 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 68/100
調査の方向性
Start in go/logic/migrator.go at Checkpoint() and resume handling, then trace currentCoordinates, LastTrxCoords, and StartSync() in go/binlog/gomysql_reader.go. Reproduce the file-position checkpoint scenario described in the issue and verify that checkpoints use a restartable transaction boundary while preserving preceding DML, allowing --resume to avoid the missing TABLE_MAP error.
索引モデルが issue の本文から書いたものです。
説明
Using gh-ost v1.1.11 (2ed192cd39d8a5173b6ef7c4beaa746a2d3bf1aa) on Aurora MySQL 8.0 with binlog_format=ROW, without --gtid.
After running with --checkpoint --execute, stopping the process, and restarting with --resume, binlog streaming repeatedly fails with:
StreamEvents encountered unexpected error:
... invalid table id, no corresponding table map event
The streamer repeatedly reconnects at the same position. Row copying can reach 100%, but binlog processing remains stuck.
Evidence
The following is an actual checkpoint and surrounding binlog events, with database/table names anonymized and irrelevant columns omitted. Numeric positions are unchanged.
mysql> SELECT gh_ost_chk_id, gh_ost_chk_coords, gh_ost_is_cutover
FROM app_db._table_a_ghk;
gh_ost_chk_id: 1
gh_ost_chk_coords: mysql-bin-changelog.001644:98771662
gh_ost_is_cutover: 0
mysql> SHOW BINLOG EVENTS
IN 'mysql-bin-changelog.001644' FROM 98746801 LIMIT 10;
Pos Event_type End_log_pos Info
98746801 Anonymous_Gtid 98746886 SET @@SESSION.GTID_NEXT='ANONYMOUS'
98746886 Query 98746991 BEGIN
98746991 Table_map 98747104 table_id: 5131 (app_db._other_table_gho; another concurrent migration)
98747104 Write_rows 98755290 table_id: 5131
98755290 Write_rows 98763476 table_id: 5131
98763476 Write_rows 98771662 table_id: 5131
98771662 Write_rows 98779848 table_id: 5131 <-- saved checkpoint
98779848 Write_rows 98786279 table_id: 5131 flags: STMT_END_F
98786279 Xid 98786310 COMMIT
98786310 Anonymous_Gtid 98786395 SET @@SESSION.GTID_NEXT='ANONYMOUS'
The checkpoint points to a Write_rows event after its required Table_map, rather than a transaction boundary.
Suspected cause
Checkpoint()savesGetCurrentBinlogCoordinates()asLastTrxCoords.
- In file-position mode,
currentCoordinatesadvances on every event, including intermediate row events.
- Resume loads the saved coordinates and passes that position directly to
StartSync(). The new reader therefore lacks the preceding table map.
The reader separately tracks completed transactions in LastTrxCoords on XID events, but checkpoint creation does not use that value.
Expected behavior
File-position checkpoints should store a restartable transaction boundary, while ensuring all preceding DML has been applied, so --resume can continue.
- 主要言語
- Go
- スター
- 13.6k
- フォーク
- 1.4k
- 平均マージ
- 9日 19時間
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
github/gh-ost のほかの issue
-
`--resume` without `--execute` drops the ghost table it correctly skipped altering対応中かも @ajm188 が 55 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 10 日以内に返信
-
[Suggestion] Apply simple validation to alter command対応中かも @drkemp187 が 106 日前に担当しました。 オープンenhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
github/gh-ost#1431 · コメント 4 件 ·
メンテナーはふだん 10 日以内に返信
-
Migration hangs when --attempt-instant-ddl succeeds対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
メンテナーはふだん 10 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
メンテナーはふだん 10 日以内に返信
-
Atomic cut-over always fails on MySQL 9.1+: information_schema.processlist errors out (3854) while another session runs a non-BMP utf8mb4 statement対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
github/gh-ost#1780 · コメント 1 件 ·
メンテナーはふだん 10 日以内に返信
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
prime-radiant-inc/evener#6325 ·
メンテナーはふだん 1 日以内に返信
-
team:library-maintainers
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
padok-team/burrito#1208 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
bazel-contrib/rules_go#4784 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
betterleaks/betterleaks#484 ·
メンテナーはふだん 1 日以内に返信