| 1 |
################################################################################ |
| 2 |
# This test proves that sequence number gap is not generated when certification |
| 3 |
# garbage collector runs during relay log rotation. |
| 4 |
# |
| 5 |
# Test: |
| 6 |
# 0. The test requires two servers: M1 and M2. |
| 7 |
# 1. Add debug point to reduce certifier broadcast time to 1 second. |
| 8 |
# Bootstrap M1 and join M2. |
| 9 |
# Relay log file size has been reduced to 4096 in CNF file. |
| 10 |
# 2. Create a table t1 and insert several transactions. |
| 11 |
# Each loop will ensure that all applier workers have assigned |
| 12 |
# transactions and cause a relay log rotate, after a certification |
| 13 |
# info garbage collection happened. |
| 14 |
# 3. Cleanup. |
| 15 |
################################################################################ |
| 16 |
|
| 17 |
--source include/have_debug.inc |
| 18 |
--source include/have_debug_sync.inc |
| 19 |
--source include/have_group_replication_plugin.inc |
| 20 |
--let $rpl_skip_group_replication_start= 1 |
| 21 |
--let $rpl_group_replication_single_primary_mode=1 |
| 22 |
--source include/group_replication.inc |
| 23 |
|
| 24 |
--echo ################################################################# |
| 25 |
--echo # 1. Add debug point to reduce certifier broadcast time to 1 second. |
| 26 |
--echo # Bootstrap M1 and join M2. |
| 27 |
--echo # Relay log file size has been reduced to 4096 in CNF file. |
| 28 |
|
| 29 |
--let $rpl_connection_name= server1 |
| 30 |
--source include/rpl_connection.inc |
| 31 |
|
| 32 |
SET @@GLOBAL.DEBUG= '+d,group_replication_certifier_broadcast_thread_short_period'; |
| 33 |
|
| 34 |
--source include/start_and_bootstrap_group_replication.inc |
| 35 |
|
| 36 |
--let $rpl_connection_name= server2 |
| 37 |
--source include/rpl_connection.inc |
| 38 |
|
| 39 |
SET @@GLOBAL.DEBUG= '+d,group_replication_certifier_broadcast_thread_short_period'; |
| 40 |
SET @@GLOBAL.DEBUG= '+d,group_replication_certifier_garbage_collection_ran'; |
| 41 |
|
| 42 |
--source include/start_group_replication.inc |
| 43 |
|
| 44 |
--echo ################################################################# |
| 45 |
--echo # 2. Create a table t1 and insert several transactions. |
| 46 |
--echo # Each loop will ensure that all applier workers have assigned |
| 47 |
--echo # transactions and cause a relay log rotate, after a certification |
| 48 |
--echo # info garbage collection happened. |
| 49 |
|
| 50 |
--let $rpl_connection_name= server1 |
| 51 |
--source include/rpl_connection.inc |
| 52 |
|
| 53 |
CREATE TABLE t1(c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 BLOB); |
| 54 |
|
| 55 |
--disable_query_log |
| 56 |
--let $relay_log_rotate=1 |
| 57 |
while ($relay_log_rotate < 5) |
| 58 |
{ |
| 59 |
--connection server2 |
| 60 |
SET DEBUG_SYNC= "now WAIT_FOR signal.group_replication_certifier_garbage_collection_finished"; |
| 61 |
|
| 62 |
--connection server1 |
| 63 |
--let $i=1 |
| 64 |
while ($i < 10) |
| 65 |
{ |
| 66 |
INSERT INTO t1 (c2) VALUES ('a'); |
| 67 |
--inc $i |
| 68 |
} |
| 69 |
|
| 70 |
--connection server2 |
| 71 |
SET DEBUG_SYNC= "now WAIT_FOR signal.group_replication_certifier_garbage_collection_finished"; |
| 72 |
|
| 73 |
--connection server1 |
| 74 |
INSERT INTO t1 (c2) VALUES (repeat('a',4096)); |
| 75 |
|
| 76 |
--inc $relay_log_rotate |
| 77 |
} |
| 78 |
--enable_query_log |
| 79 |
|
| 80 |
--echo ################################################################# |
| 81 |
--echo # 3. Cleanup. |
| 82 |
|
| 83 |
--let $rpl_connection_name= server1 |
| 84 |
--source include/rpl_connection.inc |
| 85 |
|
| 86 |
DROP TABLE t1; |
| 87 |
--source include/rpl_sync.inc |
| 88 |
|
| 89 |
--let $rpl_connection_name= server2 |
| 90 |
--source include/rpl_connection.inc |
| 91 |
|
| 92 |
--source include/stop_group_replication.inc |
| 93 |
SET @@GLOBAL.DEBUG= '-d,group_replication_certifier_broadcast_thread_short_period'; |
| 94 |
SET @@GLOBAL.DEBUG= '-d,group_replication_certifier_garbage_collection_ran'; |
| 95 |
SET DEBUG_SYNC= 'RESET'; |
| 96 |
|
| 97 |
--let $rpl_connection_name= server1 |
| 98 |
--source include/rpl_connection.inc |
| 99 |
|
| 100 |
--source include/stop_group_replication.inc |
| 101 |
SET @@GLOBAL.DEBUG= '-d,group_replication_certifier_broadcast_thread_short_period'; |
| 102 |
|
| 103 |
--source include/group_replication_end.inc |