123456789Ten One A - - the - - - + - + A at - - - - - in - to + - |
0,RC Mode 1. Semi-sync C-Phase wait Suppose that the set time-out=100000s, when the transaction one commits a large transaction, waits at the time of the write commit log (C-phase), So what stage is the second transaction at the time of the commit command? Is it stuck in Wite prepare log (phase a)? or write binlog (stage B)? or write commit log (phase C) test: Semi-sync vs loss-less Semi-sync "Semi-sync" C-Phase wait0, turn on transaction 1, and then execute the Stop slave on the slave, making the timeout condition and blocking it. (Waiting for semi-sync ACK from slave) 1, in opening a transaction 2, transaction 2 inserts a special record (XXXXX). (Waiting for semi-sync ACK from slave) 2, on opening a transaction 3. 2.1, test case: This time,kill-9 mysqld, resulting in artificial MySQL crash 3, assuming that the card is in phase A, then transaction 3, must not see Transaction 1,2 write record (XXXXX), and after restarting MySQL, transaction 2 will not commit. 4, assuming that the card is in phase C, then transaction 3, it is certainly possible to see Transactions 1,2 Write Records (XXXXX). Tested:1, is stuck in C-phase, that is, transaction 3 is can see transaction 1, Transaction 2. after 2,mysql crash restart, transaction 1, the DML for transaction 2 has been submitted successfully, stating that it is not stuck in phase a "Loss-less Semi-sync" phase B wait 0, turn on transaction 1, and then execute the Stop slave on the slave, making the timeout condition and blocking it. (Waiting for semi-sync ACK from slave) 1, in opening a transaction 2, transaction 2 inserts a special record (XXXXX). (Waiting for semi-sync ACK from slave) 2, when opening a transaction 3 3, assuming that the card is in phase A, then transaction 3, must not see Transaction 1,2 write record (XXXXX), and after restarting MySQL, transaction 2 will not commit: 4, assuming that the card is in stage B, then transaction 3, must be able to see Transactions 1,2 Write Records (XXXXX), and after restarting MySQL, transaction 1,2 commits: 5, assuming that the card is in phase C, then transaction 3, it must be possible to see transaction 3 Write Records (XXXXX). Tested:1, is stuck in the B stage, that is, transaction 3, neither see the commit content of transaction 1, also see the commit content of transaction 2, and after restarting MySQL, transaction 1,2 have been submitted. after 2,mysql crash restart, transaction 1, the DML for transaction 2 has been submitted successfully, stating that it is not stuck in phase a. |