OpenTenBase / OpenTenBase/TXSQL

BUG#34930969: Previous_gtids miss gtid when binlog_order_commits off

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

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

主要言語
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_SYNC point after_dec_prep_xids to enable deterministic testing
  • Added MTR test case rpl_previous_gtids to 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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. 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

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

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