Merge lp:~laurynas-biveinis/percona-server/fake-changes-binlog-5.1 into lp:percona-server/5.1
Status: | Superseded | ||||||||
---|---|---|---|---|---|---|---|---|---|
Proposed branch: | lp:~laurynas-biveinis/percona-server/fake-changes-binlog-5.1 | ||||||||
Merge into: | lp:percona-server/5.1 | ||||||||
Diff against target: |
309 lines (+238/-2) 5 files modified
Percona-Server/mysql-test/suite/binlog/r/binlog_percona_fake_changes.result (+72/-0) Percona-Server/mysql-test/suite/binlog/t/binlog_percona_fake_changes.test (+106/-0) Percona-Server/sql/handler.cc (+20/-1) Percona-Server/sql/handler.h (+1/-0) Percona-Server/storage/innodb_plugin/handler/ha_innodb.cc (+39/-1) |
||||||||
To merge this branch: | bzr merge lp:~laurynas-biveinis/percona-server/fake-changes-binlog-5.1 | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alexey Kopytov (community) | Needs Fixing | ||
Vlad Lesin (community) | g2 | Approve | |
Review via email: mp+170779@code.launchpad.net |
This proposal has been superseded by a proposal from 2013-08-23.
Description of the change
No BT or ST, but prerequisite for BT 20439, as well as being quite critical bug for the fake changes feature.
Fix
- bug 1190580 (Fake changes transactions are binlogged) and
- bug 1188162 (Verify in MTR that fake changes transactions are not
binlogged).
Fixed bug 1188162 by adding a testcase
binlog_
and checks that no binlog events have resulted from this. The
testcase is adopted from a similar testcase in Facebook patch
rpl_percona_
binlog only instead of setting up replication.
This testcase then immediatelly fails showing that fake changes
transactions are binlogged (bug 1190580). This is fixed by the
following.
- Adjusting innobase_
HA_ERR_
enabled and the function was called for a COMMIT statement or a DML
statement with autocommit=1. Also clear the diagnostic area. Keep
on returning success if innobase_
individual statements in a multi-statement tranaction. This causes
ha_commit_trans() not to write the transaction to binlog if fake
changes are enabled and 2PC between the storage engines and binlog
is used.
- Instead of skipping the 2PC prepare step for handlertons that are
not marked as read-write, skip it only for handlertons that are not
marked as read-write and have not fake changes enabled. The fake
changes handlertons are never marked as read-write, which causes
prepare to be skipped for them, making it impossible for its
non-success return to do anything.
- Related to above, 2PC is only used if the total number of read-write
handlertons in the transaction is at least two. Since fake changes
handlertons do not contribute to this number, add a loop in
ha_commit_trans() to bump rw_ha_count for each fake changes
transaction, which will then force 2PC to be used.
- To support the above, add a new function pointer is_fake_change to
the handlerton struct. This is also done by the Facebook patch.
http://
Laurynas,
Are there any reasons to implement a separate a loop over trans->ha_list to bump rw_ha_count instead of embedding it into the existing loop in ha_check_ and_coalesce_ trx_read_ only()? I guess that would result in a cleaner and a bit more efficient code.