OpenTenBase / OpenTenBase/TXSQL
BUG#34930969: Previous_gtids miss gtid when binlog_order_commits off
まだ誰も着手していません。
- 主要言語
- C++
- スター
- 337
- フォーク
- 234
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Problem
When binlog_order_commits is turned off, binlog rotate will wait for m_prep_xids to decrease to zero. However, m_prep_xids was decreased before updating the thread GTID to gtid_executed in MYSQL_BIN_LOG::finish_commit, causing GTIDs to be missed in the next binlog file Previous_gtids event.
Fix
The core fix moves dec_prep_xids to be called after gtid_state->update_on_commit in MYSQL_BIN_LOG::finish_commit. This ensures that when binlog rotate waits for m_prep_xids to reach zero, all GTIDs have already been registered in gtid_executed.
Additionally:
- Added
DEBUG_SYNCpointafter_dec_prep_xidsto enable deterministic testing - Added MTR test case
rpl_previous_gtidsto verify the fix
Commit
https://github.com/xyw0537/TXSQL/commit/ae7de225c2a
Branch: bugfix/previous_gtids_miss_gtid_binlog_order_commits_off
Upstream Reference
https://github.com/mysql/mysql-server/commit/a3faa6f8799e6c7c610245d2899386131731fb41
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず MYSQL_BIN_LOG::finish_commit を見つけ、dec_prep_xids と gtid_state->update_on_commit の順序を確認します。after_dec_prep_xids の DEBUG_SYNC ポイントと、MTR テストケース rpl_previous_gtids を確認します。binlog_order_commits がオフの場合に Previous_gtids にコミット済みのすべての GTID が含まれることをテストで検証できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- cpp, mysql
- 領域
- databases
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100