| 1 |
call mtr.add_suppression("Can.t init tc log"); |
| 2 |
call mtr.add_suppression("Aborting"); |
| 3 |
SET @@global.max_binlog_size= 4096; |
| 4 |
SET @@global.sync_binlog= 1; |
| 5 |
RESET MASTER; |
| 6 |
FLUSH LOGS; |
| 7 |
CREATE TABLE ti (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb; |
| 8 |
CREATE TABLE tm (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=MyISAM; |
| 9 |
connect master1,localhost,root,,; |
| 10 |
"List of binary logs before rotation" |
| 11 |
show binary logs; |
| 12 |
Log_name File_size |
| 13 |
master-bin.000001 # |
| 14 |
master-bin.000002 # |
| 15 |
INSERT INTO ti VALUES(1,"I am gonna survive"); |
| 16 |
INSERT INTO tm VALUES(1,"me too!"); |
| 17 |
SET DEBUG_SYNC= "commit_after_release_LOCK_after_binlog_sync SIGNAL master1_ready WAIT_FOR master1_go_never_arrives"; |
| 18 |
INSERT INTO ti VALUES (2, REPEAT("x", 4100)); |
| 19 |
connect master2,localhost,root,,; |
| 20 |
SET DEBUG_SYNC= "now WAIT_FOR master1_ready"; |
| 21 |
SET DEBUG_SYNC= "commit_before_get_LOCK_commit_ordered SIGNAL master2_ready WAIT_FOR master2_go_never_arrives"; |
| 22 |
INSERT INTO ti VALUES (3, "not gonna survive"); |
| 23 |
connection default; |
| 24 |
SET DEBUG_SYNC= "now WAIT_FOR master2_ready"; |
| 25 |
connect master3,localhost,root,,; |
| 26 |
SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL master3_ready WAIT_FOR master3_go_never_arrives"; |
| 27 |
INSERT INTO ti VALUES (4, "not gonna be log therefore survive"),(5, "ditto"); |
| 28 |
connection default; |
| 29 |
SET DEBUG_SYNC= "now WAIT_FOR master3_ready"; |
| 30 |
"List of binary logs before crash" |
| 31 |
show binary logs; |
| 32 |
Log_name File_size |
| 33 |
master-bin.000001 # |
| 34 |
master-bin.000002 # |
| 35 |
master-bin.000003 # |
| 36 |
# The gtid binlog state prior the crash will be truncated at the end of the test |
| 37 |
SELECT @@global.gtid_binlog_state; |
| 38 |
@@global.gtid_binlog_state |
| 39 |
0-1-6 |
| 40 |
connection default; |
| 41 |
# Kill the server |
| 42 |
disconnect master1; |
| 43 |
disconnect master2; |
| 44 |
disconnect master3; |
| 45 |
# restart: --init-rpl-role=SLAVE --sync-binlog=1 --log-warnings=3 |
| 46 |
FOUND 1 /truncated binlog file:.*master.*000002/ in mysqld.1.err |
| 47 |
"One record should be present in table" |
| 48 |
SELECT * FROM ti; |
| 49 |
a b |
| 50 |
1 I am gonna survive |
| 51 |
# The truncated gtid binlog state |
| 52 |
SELECT @@global.gtid_binlog_state; |
| 53 |
@@global.gtid_binlog_state |
| 54 |
0-1-4 |
| 55 |
SELECT @@global.gtid_binlog_pos; |
| 56 |
@@global.gtid_binlog_pos |
| 57 |
0-1-4 |
| 58 |
# Cleanup |
| 59 |
DROP TABLE ti; |
| 60 |
SET @@global.sync_binlog= default; |
| 61 |
# End of the tests |