| Bug #44672 | Assertion failed: thd->transaction.xid_state.xid.is_null() | ||
|---|---|---|---|
| Submitted: | 5 May 17:20 | Modified: | 29 Jun 21:46 |
| Reporter: | Shane Bester | ||
| Status: | Closed | ||
| Category: | Server: Locking | Severity: | S2 (Serious) |
| Version: | 5.1.35-debug, 6.0.9-debug | OS: | Any |
| Assigned to: | Davi Arnaut | Target Version: | 5.1+ |
| Tags: | regression, xa | ||
| Triage: | Triaged: D1 (Critical) | ||
[5 May 17:20]
Shane Bester
[5 May 17:33]
Valeriy Kravchuk
Verified just as described with recent 5.1.35 from bzr on Mac OS X.
[11 May 10:22]
Shane Bester
not a dos vector, nor required to have it 'private'. debug assertion affect debug binary only. nobody runs debug binaries in production.
[12 May 13:55]
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/73812 2874 Davi Arnaut 2009-05-12 Bug#44672: Assertion failed: thd->transaction.xid_state.xid.is_null() The problem is that when a optimization of read-only transactions (bypass 2-phase commit) was implemented, it removed the code that reseted the XID once a transaction wasn't active anymore: sql/sql_parse.cc: - bzero(&thd->transaction.stmt, sizeof(thd->transaction.stmt)); - if (!thd->active_transaction()) - thd->transaction.xid_state.xid.null(); + thd->transaction.stmt.reset(); This mostly worked fine as the transaction commit and rollback functions (in handler.cc) reset the XID once the transaction is ended. But those functions wouldn't reset the XID in case of a empty transaction, leading to a assertion when a new starting a new XA transaction. The solution is to ensure that the XID state is reset when empty transactions are ended (by either commit or rollback). @ mysql-test/r/xa.result Add test case result for Bug#44672 @ mysql-test/t/xa.test Add test case for Bug#44672 @ sql/handler.cc Reset the XID even for empty transactions.
[25 May 22:40]
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/74915 2911 Davi Arnaut 2009-05-25 Bug#44672: Assertion failed: thd->transaction.xid_state.xid.is_null() The problem is that when a optimization of read-only transactions (bypass 2-phase commit) was implemented, it removed the code that reseted the XID once a transaction wasn't active anymore: sql/sql_parse.cc: - bzero(&thd->transaction.stmt, sizeof(thd->transaction.stmt)); - if (!thd->active_transaction()) - thd->transaction.xid_state.xid.null(); + thd->transaction.stmt.reset(); This mostly worked fine as the transaction commit and rollback functions (in handler.cc) reset the XID once the transaction is ended. But those functions wouldn't reset the XID in case of a empty transaction, leading to a assertion when a new starting a new XA transaction. The solution is to ensure that the XID state is reset when empty transactions are ended (by either commit or rollback). This is achieved by reorganizing the code so that the transaction cleanup routine is invoked whenever a transaction is ended. @ mysql-test/r/xa.result Add test case result for Bug#44672 @ mysql-test/t/xa.test Add test case for Bug#44672 @ sql/handler.cc Invoke transaction cleanup function whenever a transaction is ended. Move XID state reset logic to the transaction cleanup function. @ sql/sql_class.h Add XID state reset logic.
[5 Jun 23:43]
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/75755 2935 Davi Arnaut 2009-06-05 Bug#44672: Assertion failed: thd->transaction.xid_state.xid.is_null() The problem is that when a optimization of read-only transactions (bypass 2-phase commit) was implemented, it removed the code that reseted the XID once a transaction wasn't active anymore: sql/sql_parse.cc: - bzero(&thd->transaction.stmt, sizeof(thd->transaction.stmt)); - if (!thd->active_transaction()) - thd->transaction.xid_state.xid.null(); + thd->transaction.stmt.reset(); This mostly worked fine as the transaction commit and rollback functions (in handler.cc) reset the XID once the transaction is ended. But those functions wouldn't reset the XID in case of a empty transaction, leading to a assertion when a new starting a new XA transaction. The solution is to ensure that the XID state is reset when empty transactions are ended (by either commit or rollback). This is achieved by reorganizing the code so that the transaction cleanup routine is invoked whenever a transaction is ended. @ mysql-test/r/xa.result Add test case result for Bug#44672 @ mysql-test/t/xa.test Add test case for Bug#44672 @ sql/handler.cc Invoke transaction cleanup function whenever a transaction is ended. Move XID state reset logic to the transaction cleanup function. @ sql/sql_class.h Add XID state reset logic.
[6 Jun 0:17]
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/75757 2935 Davi Arnaut 2009-06-05 Bug#44672: Assertion failed: thd->transaction.xid_state.xid.is_null() The problem is that when a optimization of read-only transactions (bypass 2-phase commit) was implemented, it removed the code that reseted the XID once a transaction wasn't active anymore: sql/sql_parse.cc: - bzero(&thd->transaction.stmt, sizeof(thd->transaction.stmt)); - if (!thd->active_transaction()) - thd->transaction.xid_state.xid.null(); + thd->transaction.stmt.reset(); This mostly worked fine as the transaction commit and rollback functions (in handler.cc) reset the XID once the transaction is ended. But those functions wouldn't reset the XID in case of a empty transaction, leading to a assertion when a new starting a new XA transaction. The solution is to ensure that the XID state is reset when empty transactions are ended (by either commit or rollback). This is achieved by reorganizing the code so that the transaction cleanup routine is invoked whenever a transaction is ended. @ mysql-test/r/xa.result Add test case result for Bug#44672 @ mysql-test/t/xa.test Add test case for Bug#44672 @ sql/handler.cc Invoke transaction cleanup function whenever a transaction is ended. Move XID state reset logic to the transaction cleanup function. @ sql/sql_class.h Add XID state reset logic.
[6 Jun 0:30]
Davi Arnaut
Queued to 5.1-bugteam
[16 Jun 13:04]
Bugs System
Pushed into 5.1.36 (revid:joro@sun.com-20090616102155-3zhezogudt4uxdyn) (version source revid:azundris@mysql.com-20090606160558-utmxhnb88ur1vcra) (merge vers: 5.1.36) (pib:6)
[17 Jun 21:24]
Bugs System
Pushed into 5.4.4-alpha (revid:alik@sun.com-20090616183122-chjzbaa30qopdra9) (version source revid:azundris@mysql.com-20090606160423-aym8s5rn51nmg387) (merge vers: 6.0.12-alpha) (pib:11)
[29 Jun 21:46]
Paul DuBois
Noted in 5.1.36, 5.4.4 changelogs. Code that optimized a read-only XA transaction failed to reset the XID once the transaction was no longer active.
[13 Aug 0:06]
Paul DuBois
Noted in 5.4.2 changelog because next 5.4 version will be 5.4.2 and not 5.4.4.
[15 Aug 0:57]
Paul DuBois
Ignore previous comment about 5.4.2.
[26 Aug 15:46]
Bugs System
Pushed into 5.1.37-ndb-7.0.8 (revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (version source revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (merge vers: 5.1.37-ndb-7.0.8) (pib:11)
[26 Aug 15:46]
Bugs System
Pushed into 5.1.37-ndb-6.3.27 (revid:jonas@mysql.com-20090826105955-bkj027t47gfbamnc) (version source revid:jonas@mysql.com-20090826105955-bkj027t47gfbamnc) (merge vers: 5.1.37-ndb-6.3.27) (pib:11)
[26 Aug 15:48]
Bugs System
Pushed into 5.1.37-ndb-6.2.19 (revid:jonas@mysql.com-20090825194404-37rtosk049t9koc4) (version source revid:jonas@mysql.com-20090825194404-37rtosk049t9koc4) (merge vers: 5.1.37-ndb-6.2.19) (pib:11)
[27 Aug 18:32]
Bugs System
Pushed into 5.1.35-ndb-7.1.0 (revid:magnus.blaudd@sun.com-20090827163030-6o3kk6r2oua159hr) (version source revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (merge vers: 5.1.37-ndb-7.0.8) (pib:11)
[7 Oct 22:21]
Paul DuBois
The 5.4 fix has been pushed to 5.4.2.
