| 1 |
CREATE TABLE t1 (c1 INT) Engine=InnoDB; |
| 2 |
CREATE TABLE t2 (c1 INT) Engine=InnoDB; |
| 3 |
SET GLOBAL binlog_group_commit_sync_delay=1000000; |
| 4 |
SET GLOBAL binlog_group_commit_sync_no_delay_count=2; |
| 5 |
######################## ASSERTION #1 ##################################### |
| 6 |
SET DEBUG_SYNC='bgc_after_flush_stage_before_sync_stage SIGNAL go_con2_to_flush WAIT_FOR go_con1_to_sync'; |
| 7 |
============== CON1: FLUSHed and REAPed the QUEUE Waiting for CON2 to get to the FLUSH stage ============ |
| 8 |
SET @clock_in = SYSDATE(); |
| 9 |
INSERT INTO t1 VALUES (1); |
| 10 |
SET DEBUG_SYNC='bgc_before_flush_stage SIGNAL go_con1_to_sync WAIT_FOR go_con2_to_flush'; |
| 11 |
SET DEBUG_SYNC='bgc_after_flush_stage_before_sync_stage WAIT_FOR go_con2_to_sync'; |
| 12 |
============== CON2: WILL FLUSH and REAP the QUEUE but only after CON1 has waited and signaled CON2 ============ |
| 13 |
SET @clock_in = SYSDATE(); |
| 14 |
INSERT INTO t2 VALUES (2); |
| 15 |
SET @elapsed = TIMESTAMPDIFF(MICROSECOND, @clock_in, SYSDATE()); |
| 16 |
============== CON1: signal CON2 to resume and go into SYNC stage ============ |
| 17 |
SET DEBUG_SYNC = "now SIGNAL go_con2_to_sync"; |
| 18 |
include/assert.inc ["Assert that con1 statement took more than the delay set."] |
| 19 |
============== CON2: RESUMES ============ |
| 20 |
SET @elapsed = TIMESTAMPDIFF(MICROSECOND, @clock_in, SYSDATE()); |
| 21 |
include/assert.inc ["Assert that con2 statement took more than the delay set."] |
| 22 |
######################## ASSERTION #2 ##################################### |
| 23 |
SET GLOBAL DEBUG="d,bgc_set_infinite_delay"; |
| 24 |
============== CON1: enters wait_count_or_timeout waits for CON2 to enroll for the SYNC stage ============ |
| 25 |
SET DEBUG_SYNC='bgc_after_flush_stage_before_sync_stage WAIT_FOR go_con1_to_wait'; |
| 26 |
SET DEBUG_SYNC='bgc_wait_count_or_timeout SIGNAL go_con2_to_flush WAIT_FOR go_con1_resume_wait'; |
| 27 |
SET @clock_in = SYSDATE(); |
| 28 |
INSERT INTO t1 VALUES (1); |
| 29 |
============== CON2: signals CON1 that it has enrolled for the SYNC stage ============ |
| 30 |
SET DEBUG_SYNC='bgc_before_flush_stage SIGNAL go_con1_to_wait WAIT_FOR go_con2_to_flush'; |
| 31 |
SET DEBUG_SYNC='bgc_after_enrolling_for_sync_stage SIGNAL go_con1_resume_wait'; |
| 32 |
INSERT INTO t2 VALUES (2); |
| 33 |
SET GLOBAL DEBUG="";; |
| 34 |
SET GLOBAL binlog_group_commit_sync_no_delay_count=0; |
| 35 |
SET GLOBAL binlog_group_commit_sync_delay=0; |
| 36 |
DROP TABLE t1, t2; |