summaryrefslogtreecommitdiff
path: root/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test')
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test98
1 files changed, 98 insertions, 0 deletions
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test b/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test
new file mode 100644
index 00000000000..0668c246624
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test
@@ -0,0 +1,98 @@
+#
+# Test that if the gcache rolls over while IST is in progress, IST will still complete.
+# This is achieved by using the ist_sender_send_after_get_buffers Galera dbug sync point to block the donor after
+# the first gcache buffer has been locked for IST.
+#
+# After IST blocks, we roll over the gcache and resume IST to confirm that it completes successfully.
+#
+# Two nodes perform IST at the same time in order to make the test more stressfull
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+--source suite/galera/include/galera_have_debug_sync.inc
+
+--let $galera_connection_name = node_3
+--let $galera_server_number = 3
+--source include/galera_connect.inc
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+INSERT INTO t1 VALUES (01), (02), (03), (04), (05);
+
+# Disconnect nodes #2 and #3
+--connection node_2
+--source suite/galera/include/galera_unload_provider.inc
+
+--connection node_3
+--source suite/galera/include/galera_unload_provider.inc
+
+--connection node_1
+--source include/wait_until_connected_again.inc
+INSERT INTO t1 VALUES (11), (12), (13), (14), (15);
+
+# Wait until nodes #2 and #3 have left
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+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';
+
+# ... and restart providers to force IST
+--connection node_2
+--disable_query_log
+--eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig';
+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig';
+--enable_query_log
+
+--connection node_1
+INSERT INTO t1 VALUES (31), (32), (33), (34), (35);
+
+--connection node_3
+--disable_query_log
+--eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig';
+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig';
+--enable_query_log
+
+--connection node_1
+--sleep 2
+SHOW STATUS LIKE 'wsrep_debug_sync_waiters';
+
+INSERT INTO t1 VALUES (41), (42), (43), (44), (45);
+
+# Roll over gcache by writing a lot of information to it
+
+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));
+
+# 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=';
+
+INSERT INTO t1 VALUES (51), (52), (53), (54), (55);
+
+--connection node_2
+--source include/wait_until_connected_again.inc
+
+--connection node_3
+--source include/wait_until_connected_again.inc
+
+# Final checks
+--connection node_2
+SELECT COUNT(*) = 30 FROM t1;
+SELECT COUNT(*) = 3 FROM t2;
+SELECT LENGTH(f1) = 512 * 1024 FROM t2;
+CALL mtr.add_suppression("WSREP: Unsupported protocol downgrade: incremental data collection disabled");
+
+# Final checks
+--connection node_3
+SELECT COUNT(*) = 30 FROM t1;
+SELECT COUNT(*) = 3 FROM t2;
+SELECT LENGTH(f1) = 512 * 1024 FROM t2;
+CALL mtr.add_suppression("WSREP: Unsupported protocol downgrade: incremental data collection disabled");
+
+DROP TABLE t1, t2;