[MDEV-4470] the replication broken when use the xa transcation Created: 2013-05-02 Updated: 2013-05-02 Resolved: 2013-05-02 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.0.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical |
| Reporter: | boyce (Inactive) | Assignee: | Elena Stepanova |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Description |
|
the replication broken when use the xa transaction
restart the master
why? I did the xa commit '111', but no result return, maybe another bug?
value(1,1) return at this time, why? what's happen on the slave?
the replication is broken now!! |
| Comments |
| Comment by boyce (Inactive) [ 2013-05-02 ] | ||||||||||||||||||
|
the replication broken when use the xa transaction
---------
---------
---
--- what's hanppen on the slave?
---
--- | ||||||||||||||||||
| Comment by Elena Stepanova [ 2013-05-02 ] | ||||||||||||||||||
|
Hi, So, there were two questions in here:
The answer to the first question is that it's a limitation of MySQL XA transactions, see MySQL manual (http://dev.mysql.com/doc/refman/5.6/en/xa-restrictions.html): This is exactly your scenario. The answer to the second question is less obvious. From all I see in your scenario, it's not an exact quote from your MySQL client, but rather a manual compilation of different bits and pieces. There are several indications of it: a) prepare '222'; b) the second "xa commit '111';" (after "prepare '222'") would have caused "Unknown XID" error or such, since you had already committed '111' before; c) since you had never issued "xa commit '222'", there is no way (2,2) would have appeared on slave. So, something is obviously missing here, and something is wrong. My best guess is that by the time of your first "select * from t" you hadn't actually issued "xa commit '111'" yet, in this case you would have received an empty set indeed, even although the transaction is in prepared state. Please let us know whether the above answers your questions. Thanks. | ||||||||||||||||||
| Comment by boyce (Inactive) [ 2013-05-02 ] | ||||||||||||||||||
mysql> truncate table t; mysql> xa start '111'; mysql> insert into t(a) values(1); mysql> xa end '111'; mysql> xa prepare '111'; kill -9 pid at this time mysql> xa recover; ---------
---------
--------- mysql> select * from t; mysql> xa commit '111'; mysql> select * from t; why? the value(1,1) not return! mysql> xa start '222'; mysql> insert into t(a) values(2); mysql> xa end '222'; mysql> xa prepare '222'; mysql> xa commit '222'; mysql> select * from t;
---
--- why? return the value(1,1),(2,2)? | ||||||||||||||||||
| Comment by Elena Stepanova [ 2013-05-02 ] | ||||||||||||||||||
|
Thanks, it makes sense now. The important difference is yet another SELECT which you ran between XA RECOVER '111' and XA COMMIT '111'. MariaDB [test]> create table t(id int auto_increment primary key, a int) engine=innodb; MariaDB [test]> xa start '111'; MariaDB [test]> insert into t(a) values(1); MariaDB [test]> xa end '111'; MariaDB [test]> xa prepare '111'; MariaDB [test]> system killall -s 9 mysqld MariaDB [test]> xa recover; ---------
---------
--------- MariaDB [test]> select * from t; MariaDB [test]> xa commit '111'; MariaDB [test]> select * from t; MariaDB [test]> select sql_no_cache * from t;
---
--- MariaDB [test]> show status like 'Qcache_hits';
--------------
-------------- As you can see above, the SELECT hits the query cache. I'd say it's a bug, but I suggest to file it separately. | ||||||||||||||||||
| Comment by boyce (Inactive) [ 2013-05-02 ] | ||||||||||||||||||
|
Thanks mysql> truncate table t; mysql> mysql> xa start '111'; mysql> insert into t(a) values(1); mysql> xa end '111'; mysql> xa prepare '111'; mysql> xa recover; ---------
---------
--------- mysql> xa commit '111'; mysql> select * from t;
---
--- | ||||||||||||||||||
| Comment by Elena Stepanova [ 2013-05-02 ] | ||||||||||||||||||
|
As discussed in the comments, the issue with replication is a known MySQL XA limitation, so I am closing it as 'Not a bug'. | ||||||||||||||||||
| Comment by Jeremy Cole [ 2013-05-02 ] | ||||||||||||||||||
|
For tracking purposes maybe it makes sense to create a new resolution of "Known bug with upstream" and use that for such cases. This is very definitely a bug, just not a bug with MariaDB exclusively. | ||||||||||||||||||
| Comment by Elena Stepanova [ 2013-05-02 ] | ||||||||||||||||||
|
For tracking purposes we have that, it's label 'upstream'. But which part do you mean saying "definitely a bug" – replication issue or the SELECT with query cache? I wouldn't even bother to file it as a bug at bugs.mysql.com, it will be closed immediately as a documented limitation. SELECT is a bug, it's been filed separately, as said before. |