Merge lp:~sergei.glushchenko/percona-server/ST28246-bug1092593-5.1 into lp:percona-server/5.1
Status: | Merged |
---|---|
Approved by: | Laurynas Biveinis |
Approved revision: | no longer in the source branch. |
Merged at revision: | 561 |
Proposed branch: | lp:~sergei.glushchenko/percona-server/ST28246-bug1092593-5.1 |
Merge into: | lp:percona-server/5.1 |
Diff against target: |
136 lines (+112/-0) 4 files modified
Percona-Server/mysql-test/suite/rpl/r/rpl_percona_bug1092593.result (+20/-0) Percona-Server/mysql-test/suite/rpl/t/rpl_percona_bug1092593-slave.opt (+1/-0) Percona-Server/mysql-test/suite/rpl/t/rpl_percona_bug1092593.test (+81/-0) Percona-Server/storage/innodb_plugin/trx/trx0trx.c (+10/-0) |
To merge this branch: | bzr merge lp:~sergei.glushchenko/percona-server/ST28246-bug1092593-5.1 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Laurynas Biveinis (community) | Approve | ||
Review via email: mp+160069@code.launchpad.net |
Description of the change
Bug 1092593: crash resistant replication doesn't work correctly after change
master or reset slave
- further might look rather unstructured; so one might benefit from
refreshing discussion here
https:/
before reading this
- this is how I imagine XA-transactions flow
* BEGIN do something PREPARE COMMIT BEGIN do something PREPARE COMMIT
* on each state ROLLBACK can be issued except after
the COMMIT has been completed successfully and BEGIN is not issued
(it this case ROLLBACK will just be noop)
* ROLLBACK should leave us somewhere before the BEGIN
- when InnoDB performs recovery it takes binlog position
from the "prepare" point.
- after this XA transaction can be reverted or committed
- if XA transaction is reverted then we take binlog position
from "commit" point which in this case is older than "prepare"
- if XA transaction is committed then we continue to use "prepare"
which in this case of same age as "commit" point
- this however does not work when XA transactions are not in use;
in this case we never write "prepare" points
- this might be masked by the fact that we never have real info
in "prepare" points so it's content is not overwrite MySQL *-info
files; it is still bad because we don't really have transactional
writes for binlog position as has been claimed in the documentation
- solution of this problem looks trivial for me; on commit we should
overwrite both "prepare" and "commit"; this doesn't make any harm
as after commit there is no way back to prepare anyway, so XA-case
continues to work
- non XA case will look as following
BEGIN do something COMMIT BEGIN do something COMMIT
* commit and prepare become the one commit point after which
there is no way back and it is reflected in our "commit" and
"prepare" points holding the same binlog position; rollback
is possible to the previous commit point only
http://
The code is OK.
Please update the bug telling the root cause of the issue (crash-resistant recovery does not work when InnoDB operates in 1PC, i.e. binlog disabled) for SEO.
Comments for the testcase:
- The testcase does not need not_valgrind.inc. It shutdowns the server. inc, which is a clean
server cleanly, which is compatible with Valgrind.
- What does "# Kill the server without sending a shutdown
command" mean? Is it supposed to mean the same as just "kill
the server" as opposed to "shutdown the server"? This comment
appears before rpl_restart_
restart.
- Why do you do shutdown and start server in separate steps in
diff lines 108--115 instead of just restarting it? I don't see
any action in the middle.