| 1 |
CREATE TABLE t1 (a VARCHAR(10) PRIMARY KEY) ENGINE=innodb; |
| 2 |
INSERT INTO t1 VALUES("default"); |
| 3 |
SELECT variable_value INTO @commits FROM information_schema.global_status |
| 4 |
WHERE variable_name = 'binlog_commits'; |
| 5 |
SELECT variable_value INTO @group_commits FROM information_schema.global_status |
| 6 |
WHERE variable_name = 'binlog_group_commits'; |
| 7 |
connect con1,localhost,root,,; |
| 8 |
connect con2,localhost,root,,; |
| 9 |
connect con3,localhost,root,,; |
| 10 |
connect con4,localhost,root,,; |
| 11 |
connect con5,localhost,root,,; |
| 12 |
connect con6,localhost,root,,; |
| 13 |
connection con1; |
| 14 |
SET DEBUG_SYNC= "commit_before_get_LOCK_after_binlog_sync SIGNAL group1_running WAIT_FOR group2_queued"; |
| 15 |
INSERT INTO t1 VALUES ("con1"); |
| 16 |
connection con2; |
| 17 |
set DEBUG_SYNC= "now WAIT_FOR group1_running"; |
| 18 |
SET DEBUG_SYNC= "commit_after_prepare_ordered SIGNAL group2_con2"; |
| 19 |
SET DEBUG_SYNC= "commit_before_get_LOCK_after_binlog_sync SIGNAL group2_running"; |
| 20 |
SET DEBUG_SYNC= "commit_after_release_LOCK_log WAIT_FOR group3_committed"; |
| 21 |
INSERT INTO t1 VALUES ("con2"); |
| 22 |
connection con3; |
| 23 |
SET DEBUG_SYNC= "now WAIT_FOR group2_con2"; |
| 24 |
SET DEBUG_SYNC= "commit_after_prepare_ordered SIGNAL group2_con3"; |
| 25 |
INSERT INTO t1 VALUES ("con3"); |
| 26 |
connection con4; |
| 27 |
SET DEBUG_SYNC= "now WAIT_FOR group2_con3"; |
| 28 |
SET DEBUG_SYNC= "commit_after_prepare_ordered SIGNAL group2_con4"; |
| 29 |
SET DEBUG_SYNC= "commit_after_group_run_commit_ordered SIGNAL group2_visible WAIT_FOR group2_checked"; |
| 30 |
INSERT INTO t1 VALUES ("con4"); |
| 31 |
connection default; |
| 32 |
SET DEBUG_SYNC= "now WAIT_FOR group2_con4"; |
| 33 |
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; |
| 34 |
SELECT * FROM t1 ORDER BY a; |
| 35 |
a |
| 36 |
default |
| 37 |
SET DEBUG_SYNC= "now SIGNAL group2_queued"; |
| 38 |
connection con1; |
| 39 |
connection default; |
| 40 |
SELECT * FROM t1 ORDER BY a; |
| 41 |
a |
| 42 |
con1 |
| 43 |
default |
| 44 |
connection con5; |
| 45 |
SET DEBUG_SYNC= "commit_before_get_LOCK_after_binlog_sync SIGNAL group3_con5"; |
| 46 |
SET DEBUG_SYNC= "commit_after_get_LOCK_log SIGNAL con5_leader WAIT_FOR con6_queued"; |
| 47 |
set DEBUG_SYNC= "now WAIT_FOR group2_running"; |
| 48 |
INSERT INTO t1 VALUES ("con5"); |
| 49 |
connection con6; |
| 50 |
SET DEBUG_SYNC= "now WAIT_FOR con5_leader"; |
| 51 |
SET DEBUG_SYNC= "commit_after_prepare_ordered SIGNAL con6_queued"; |
| 52 |
INSERT INTO t1 VALUES ("con6"); |
| 53 |
connection default; |
| 54 |
SET DEBUG_SYNC= "now WAIT_FOR group3_con5"; |
| 55 |
SELECT * FROM t1 ORDER BY a; |
| 56 |
a |
| 57 |
con1 |
| 58 |
default |
| 59 |
SET DEBUG_SYNC= "now SIGNAL group3_committed"; |
| 60 |
SET DEBUG_SYNC= "now WAIT_FOR group2_visible"; |
| 61 |
SELECT * FROM t1 ORDER BY a; |
| 62 |
a |
| 63 |
con1 |
| 64 |
con2 |
| 65 |
con3 |
| 66 |
con4 |
| 67 |
default |
| 68 |
SET DEBUG_SYNC= "now SIGNAL group2_checked"; |
| 69 |
connection con2; |
| 70 |
connection con3; |
| 71 |
connection con4; |
| 72 |
connection con5; |
| 73 |
connection con6; |
| 74 |
connection default; |
| 75 |
SELECT * FROM t1 ORDER BY a; |
| 76 |
a |
| 77 |
con1 |
| 78 |
con2 |
| 79 |
con3 |
| 80 |
con4 |
| 81 |
con5 |
| 82 |
con6 |
| 83 |
default |
| 84 |
SELECT variable_value - @commits FROM information_schema.global_status |
| 85 |
WHERE variable_name = 'binlog_commits'; |
| 86 |
variable_value - @commits |
| 87 |
6 |
| 88 |
SELECT variable_value - @group_commits FROM information_schema.global_status |
| 89 |
WHERE variable_name = 'binlog_group_commits'; |
| 90 |
variable_value - @group_commits |
| 91 |
3 |
| 92 |
SET DEBUG_SYNC= 'RESET'; |
| 93 |
DROP TABLE t1; |