Commit d01328d7 authored by Teemu Ollakka's avatar Teemu Ollakka Committed by Nirbhay Choubey

Helpers to deal with galera dbug sync points.

parent 17b5cb61
SET GLOBAL wsrep_provider_options = 'dbug=';
--eval SET GLOBAL wsrep_provider_options = 'dbug=d,$galera_sync_point'
--eval SET GLOBAL wsrep_provider_options = 'signal=$galera_sync_point'
let $wait_timeout = 10;
SET SESSION wsrep_on = 0;
--let $wait_condition = SELECT 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters' AND VARIABLE_VALUE = '$galera_sync_point'
--source include/wait_condition.inc
SET SESSION wsrep_on = 1;
......@@ -2,6 +2,8 @@ CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
INSERT INTO t1 VALUES (1);
SET SESSION wsrep_sync_wait = 0;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
......
......@@ -10,6 +10,8 @@ f1 f2
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
COMMIT;;
SET SESSION wsrep_sync_wait = 0;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
UPDATE t1 SET f2 = 'c' WHERE f1 = 2;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_enter_sync';
......
......@@ -18,7 +18,9 @@
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
--connection node_2
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
--let $galera_sync_point = apply_monitor_slave_enter_sync
--source include/galera_set_sync_point.inc
--connection node_1
INSERT INTO t1 VALUES (1);
......@@ -27,8 +29,7 @@ INSERT INTO t1 VALUES (1);
SET SESSION wsrep_sync_wait = 0;
# Wait until applier has blocked
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters' AND VARIABLE_VALUE = 'apply_monitor_slave_enter_sync'
--source include/wait_condition.inc
--source include/galera_wait_sync_point.inc
SELECT COUNT(*) = 0 FROM t1;
......@@ -41,8 +42,8 @@ SELECT COUNT(*) = 0 FROM t1;
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'Init' AND INFO = 'FLUSH TABLES WITH READ LOCK'
--source include/wait_condition.inc
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
--source include/galera_clear_sync_point.inc
--source include/galera_signal_sync_point.inc
--connection node_2a
--reap
......
......@@ -27,7 +27,9 @@ UPDATE t1 SET f2 = 'c' WHERE f1 > 2;
--connection node_2
# Make sure IST will block ...
SET GLOBAL wsrep_provider_options = 'dbug=d,recv_IST_after_apply_trx';
--let $galera_sync_point = recv_IST_after_apply_trx
--source include/galera_set_sync_point.inc
SET SESSION wsrep_sync_wait = 0;
......
......@@ -23,7 +23,8 @@ SELECT * FROM t1 WHERE f1 = 2 FOR UPDATE;
# Block the commit
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
--let $galera_sync_point = commit_monitor_enter_sync
--source include/galera_set_sync_point.inc
--connection node_1
--send COMMIT;
......@@ -31,8 +32,7 @@ SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
# Wait until commit is blocked
--connection node_1a
SET SESSION wsrep_sync_wait = 0;
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters' AND VARIABLE_VALUE = 'commit_monitor_enter_sync'
--source include/wait_condition.inc
--source include/galera_wait_sync_point.inc
# Issue a conflicting update on node #2
--connection node_2
......@@ -48,8 +48,8 @@ UPDATE t1 SET f2 = 'c' WHERE f1 = 2;
# Unblock the commit
--connection node_1a
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_enter_sync';
--source include/galera_clear_sync_point.inc
--source include/galera_signal_sync_point.inc
# Commit succeeds
--connection node_1
......
......@@ -16,8 +16,8 @@ CREATE TABLE t2 (f1 LONGTEXT);
INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
SET GLOBAL wsrep_provider_options = 'signal=ist_sender_send_after_get_buffers';
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'signal=ist_sender_send_after_get_buffers';
INSERT INTO t1 VALUES (51), (52), (53), (54), (55);
SELECT COUNT(*) = 30 FROM t1;
COUNT(*) = 30
......
......@@ -38,7 +38,8 @@ INSERT INTO t1 VALUES (11), (12), (13), (14), (15);
INSERT INTO t1 VALUES (21), (22), (23), (24), (25);
# Make sure IST will block ...
SET GLOBAL wsrep_provider_options = 'dbug=d,ist_sender_send_after_get_buffers';
--let $galera_sync_point = ist_sender_send_after_get_buffers
--source include/galera_set_sync_point.inc
# ... and restart providers to force IST
--connection node_2
......@@ -70,8 +71,8 @@ INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
# Unlock IST and wait for it to complete
SET GLOBAL wsrep_provider_options = 'signal=ist_sender_send_after_get_buffers';
SET GLOBAL wsrep_provider_options = 'dbug=';
--source include/galera_clear_sync_point.inc
--source include/galera_signal_sync_point.inc
INSERT INTO t1 VALUES (51), (52), (53), (54), (55);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment