[MDEV-685] LP:662714 - PBXT replication failure with simple transactions Created: 2010-10-18 Updated: 2013-05-07 Resolved: 2013-05-07 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 5.5.28, 5.3.9, 5.1.62 |
| Fix Version/s: | 5.5.31, 5.2.15, 5.3.13 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Philip Stoev (Inactive) | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | Launchpad, pbxt | ||
| Attachments: |
|
| Description |
|
The following test causes PBXT replication to fail:
The error is Last_SQL_Error Could not execute Update_rows event on table test.table10_pbxt_int_autoinc; Can't find record in 'table10_pbxt_int_autoinc', Error_code: 1032; handler error HA_ERR_END_OF_FILE; the event's master log master-bin.000001, end_log_pos 1083 |
| Comments |
| Comment by Philip Stoev (Inactive) [ 2010-10-18 ] |
|
Re: PBXT replication failure with autocommit=ON/OFF |
| Comment by Kristian Nielsen [ 2010-10-18 ] |
|
Re: PBXT replication failure with simple transactions --source include/have_pbxt.inc The failing update is not rolled back as it should be; it leaves the primary key of the first row changed from 2 to 20. |
| Comment by Kristian Nielsen [ 2010-10-18 ] |
|
Re: PBXT replication failure with simple transactions From the PBXT documentation, http://www.primebase.org/documentation/#diffs : 8.2 No Statement Level Sub-transactions PBXT does not support statement level sub-transactions. This means that if an error occurs, PBXT will rollback the entire transaction, not just the current statement. The only exception to this is the duplicate key error. PBXT undoes the INSERT or UPDATE statement when an duplicate key error occurs. The user is then free to decide whether to continue, or rollback the transaction. Note that this can cause problems for replication, and means that INSERT with multiple rows should not be used when replicating PBXT tables. For example: use test;
select * from t; In the above example, the INSERT statement is not completely rolled back. MySQL replication, however, will not replicate any part of the statement because it assumes that a transactional storage engine supports statement level sub-transactions. In the original test case, the first UPDATE statement fails, and is therefore not replicated, however it is not completely rolled back despite what the pbxt documentation says. |
| Comment by Philip Stoev (Inactive) [ 2010-10-18 ] |
|
Re: [Bug 662714] Re: PBXT replication failure with simple transactions Philip Stoev |
| Comment by Kristian Nielsen [ 2010-10-18 ] |
|
Re: PBXT replication failure with simple transactions I don't know if PBXT should be able to roll back only the statement that fails with duplicate key error, as the documentation states. But if not, it should do like NDB, which also is not able to roll back single statements that fail. In this case, the transaction should be marked as failed, and any further operations in the transaction should cause an error (including commit, but excluding rollback of course). This will force the transaction to roll back in its entirety, and replication will not fail. Philip, a possible work-around might be if you can in your tests detect failing statements, and in such cases roll back the entire transactions. This might be useful for any engine that lacks the ability to roll back single statements. |
| Comment by Rasmus Johansson (Inactive) [ 2010-10-19 ] |
|
Launchpad bug id: 662714 |
| Comment by Paul McCullagh (Inactive) [ 2010-10-19 ] |
|
Re: PBXT replication failure with simple transactions The documentation is incorrect. The "statement undo", is only done correctly in the special case that the statement only affects one row. At least, this is all that is done in the current implementation. As you say, PBXT should return an error in all other cases, and then continue to return an error until the end of the transaction. |
| Comment by Elena Stepanova [ 2012-11-02 ] |
|
Setting to minor because it's PBXT |
| Comment by Sergei Petrunia [ 2013-05-07 ] |
|
PBXT is no longer developed. |