Bug #26418 | Slave out of sync after CREATE/DROP TEMPORARY TABLE + ROLLBACK on master | ||
---|---|---|---|
Submitted: | 15 Feb 2007 18:00 | Modified: | 18 Jul 2007 16:46 |
Reporter: | Matthias Leich | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S2 (Serious) |
Version: | 5.1 | OS: | Any |
Assigned to: | Georgi Kodinov | CPU Architecture: | Any |
[15 Feb 2007 18:00]
Matthias Leich
[15 Feb 2007 18:03]
Matthias Leich
test script
Attachment: rpl_mlx.test (application/octet-stream, text), 2.04 KiB.
[31 Mar 2007 23:55]
Bugs System
Pushed into 5.1.18-beta
[18 Jun 2007 10:51]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/28975 ChangeSet@1.2550, 2007-06-18 13:51:04+03:00, gkodinov@magare.gmz +14 -0 Bug #26418: Slave out of sync after CREATE/DROP TEMPORARY TABLE + ROLLBACK on master To compensate for that fact that CREATE TEMPORARY TABLE is processed outside the current client transaction the replication master records the log for roll-backed transactions as well if they happen to contain CREATE/DROP TEMPORARY TABLE. This causes problems if there are DML statements in the same transaction on tables that have different engine types between the slave and the master. In such cases the storage engine on the slave may not be able to rollback the changes in the DML target tables. DROP TEMPORARY TABLE doesn't cause an implicit commit. It is also rolled back by a ROLLBACK statement. It is an ordinary statement in that respect. Fixed the bug by not sending to the replication slave the transaction log of a rolled back transaction (followed by a ROLLBACK) when there is DROP TEMPORARY TABLE in the transction. Also replaced repeating code with a function call. Added a separate test case (to be merged later to the updated rpl_dll.test).
[18 Jun 2007 16:42]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/29016 ChangeSet@1.2550, 2007-06-18 19:42:18+03:00, gkodinov@magare.gmz +14 -0 Bug #26418: Slave out of sync after CREATE/DROP TEMPORARY TABLE + ROLLBACK on master The transaction ability of the storage engines of the tables on the replication master and the replication slave must generally be the same. When the storage engine type of the slave is non-transactional then transactions on the master that mix update of transactional and non-transactional tables should be avoided because they will cause inconsistency of the data between the master's transactional table and the slave's non-transactional table. The effect described by this bug is actually expected. A detailed test case is added (to be merged later to the updated rpl_ddl.test), as there was no coverage by the existing tests. Some code cleanup is also added by this change.
[25 Jun 2007 21:48]
Bugs System
Pushed into 5.1.21-beta
[18 Jul 2007 16:46]
Paul DuBois
No changelog entry needed, but I've updated the replication chapter to amplify on the dangers of replicating transactional master tables to non-transactional slave tables when the master side mixes updates of transactional and non-transactional tables.