OpenTenBase / OpenTenBase/TXSQL

BUG#34930969: Previous_gtids miss gtid when binlog_order_commits off

未关闭
#94 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
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. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 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 摘要。