Skip to content

Commit

Permalink
add mysql-xa-bug-verify
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyanlei25 committed Apr 11, 2018
1 parent ff87dec commit e98cbab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Binary file added doc/mysql-xa-bug-verify.pdf
Binary file not shown.
5 changes: 5 additions & 0 deletions doc/mysql-xa-bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ cetus向后端分片发送xa prepare,分片MySQL主库接收到xa prepare,xa
以上两种情况,主库的xa事务状态,跟binlog记录的事务状态不一致。在MySQL官方文档找到解释,MySQL异常关闭,有可能导致数据库状态和binlog不一致。这些bug,在非正常关闭MySQL时才出现,正常关闭mysql不会出现这个问题。如果出现xa事务悬挂,可以用[Cetus xa悬挂处理工具](https://github.com/Lede-Inc/cetus/blob/master/doc/cetus-xa.md)自动处理。

## 官方的描述

XA is not fully resilient to an unexpected halt with respect to the binary log (on the master). If there is an unexpected halt before XA PREPARE, between XA PREPARE and XA COMMIT (or XA ROLLBACK), or after XA COMMIT (or XA ROLLBACK), the server and binary log are correctly recovered and taken to a consistent state. However, if there is an unexpected halt in the middle of the execution of one of these statements, the server may not be able to recover to a correct state, leaving the server and the binary log in an inconsistent state.
已提交至官方的xa bug:
XA prepare is logged ahead of engine prepare
https://bugs.mysql.com/bug.php?id=76233

## 详细的验证

[MySQL 5.7.21 XA bug 详细验证](https://github.com/Lede-Inc/cetus/blob/master/doc/mysql-xa-bug-verify.pdf)

0 comments on commit e98cbab

Please sign in to comment.