| 1 |
# Scenario: |
| 2 |
# SigCon= ({R(B), W(B)}) |
| 3 |
# SQLThread=({R(B), W(B), C}, HIGH_PRIORITY). |
| 4 |
# |
| 5 |
# Outcome: SigCon must abort, SQLThread must commit. |
| 6 |
|
| 7 |
# no need to rerun this test three times |
| 8 |
--source include/have_binlog_format_mixed.inc |
| 9 |
|
| 10 |
--source include/have_debug.inc |
| 11 |
--source include/have_debug_sync.inc |
| 12 |
--source include/master-slave.inc |
| 13 |
|
| 14 |
--source include/rpl_connection_slave.inc |
| 15 |
SET GLOBAL DEBUG="+d,dbug_set_high_prio_sql_thread"; |
| 16 |
|
| 17 |
# now applier thread starts with high prio |
| 18 |
# since we are now setting the internal flag |
| 19 |
--source include/stop_slave_sql.inc |
| 20 |
--source include/start_slave_sql.inc |
| 21 |
|
| 22 |
--source include/rpl_connection_master.inc |
| 23 |
|
| 24 |
####### MASTER ####### |
| 25 |
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; |
| 26 |
INSERT INTO t1 VALUES (0); |
| 27 |
|
| 28 |
####### SIGCON ####### |
| 29 |
--let $rpl_connection_name= sigcon |
| 30 |
--let $rpl_server_number= 2 |
| 31 |
--source include/rpl_connect.inc |
| 32 |
|
| 33 |
--echo [connection sigcon] |
| 34 |
--let $sync_slave_connection= sigcon |
| 35 |
--source include/sync_slave_sql_with_master.inc |
| 36 |
|
| 37 |
SET DEBUG_SYNC='ha_innobase_end_statement WAIT_FOR waiting1'; |
| 38 |
|
| 39 |
BEGIN; |
| 40 |
--send UPDATE t1 SET c1=99 WHERE c1=0 |
| 41 |
|
| 42 |
####### SLAVE ####### |
| 43 |
--source include/rpl_connection_slave.inc |
| 44 |
# Wait until sigcon reaches the ha_innobase_update_row_done debug sync point. |
| 45 |
--let $wait_condition=SELECT COUNT(*)=1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE State = 'debug sync point: ha_innobase_end_statement' |
| 46 |
--source include/wait_condition.inc |
| 47 |
|
| 48 |
####### MASTER ####### |
| 49 |
--source include/rpl_connection_master.inc |
| 50 |
UPDATE t1 SET c1=1 WHERE c1=0; |
| 51 |
|
| 52 |
####### SLAVE ####### |
| 53 |
--source include/rpl_connection_slave.inc |
| 54 |
|
| 55 |
# Wait for c1 in t1 to be 1 |
| 56 |
--let $wait_condition=SELECT COUNT(*)=1 FROM t1 WHERE c1=1 |
| 57 |
--source include/wait_condition.inc |
| 58 |
|
| 59 |
# Now signal the waiting thread on sigcon to resume |
| 60 |
# and it should end up in an error stating that it |
| 61 |
# was aborted |
| 62 |
SET DEBUG_SYNC='now SIGNAL waiting1'; |
| 63 |
|
| 64 |
####### SIGCON ####### |
| 65 |
--echo [connection sigcon] |
| 66 |
--let $rpl_connection_name= sigcon |
| 67 |
--source include/rpl_connection.inc |
| 68 |
--reap |
| 69 |
# FIXME: This seems to be an error in the server layer. Control doesn't reach |
| 70 |
# the InnoDB handler methods. |
| 71 |
#--error ER_ERROR_DURING_COMMIT |
| 72 |
--error ER_ERROR_DURING_COMMIT |
| 73 |
COMMIT; |
| 74 |
|
| 75 |
--disconnect sigcon |
| 76 |
|
| 77 |
####### SLAVE ####### |
| 78 |
--connection master |
| 79 |
--let $sync_slave_connection= slave |
| 80 |
--source include/sync_slave_sql_with_master.inc |
| 81 |
|
| 82 |
--let $assert_text= 'There is a 1 in t1' |
| 83 |
--let $assert_cond= [SELECT COUNT(*) AS count FROM t1 WHERE t1.c1 = 1, count, 1] = 1 |
| 84 |
--source include/assert.inc |
| 85 |
|
| 86 |
--let $assert_text= 'There is no 0 in t1' |
| 87 |
--let $assert_cond= [SELECT COUNT(*) AS count FROM t1 WHERE t1.c1 = 0, count, 1] = 0 |
| 88 |
--source include/assert.inc |
| 89 |
|
| 90 |
--let $assert_text= 'There is no 99 in t1' |
| 91 |
--let $assert_cond= [SELECT COUNT(*) AS count FROM t1 WHERE t1.c1 = 99, count, 1] = 0 |
| 92 |
--source include/assert.inc |
| 93 |
|
| 94 |
# Clean up. |
| 95 |
--connection master |
| 96 |
DROP TABLE t1; |
| 97 |
--source include/sync_slave_sql_with_master.inc |
| 98 |
|
| 99 |
# resetting the applier thread |
| 100 |
--source include/stop_slave_sql.inc |
| 101 |
SET GLOBAL DEBUG="-d,dbug_set_high_prio_sql_thread"; |
| 102 |
--source include/start_slave_sql.inc |
| 103 |
|
| 104 |
--source include/rpl_end.inc |