| 1 |
################################################################################ |
| 2 |
# Validate group_replication_consistency= 'BEFORE' behaviour when executed |
| 3 |
# concurrently with STOP GROUP_REPLICATION. |
| 4 |
# |
| 5 |
# Test: |
| 6 |
# 00. The test requires one server: M1. |
| 7 |
# 01. Bootstrap the group on server1. |
| 8 |
# Stop it making it to block just before leave the group. |
| 9 |
# 02. Execute transaction T1 with BEFORE consistency, it |
| 10 |
# will not be allowed to execute since plugin is stopping, |
| 11 |
# otherwise there may be a deadlock on the waiting conditions. |
| 12 |
# 03. Execute transaction T1 with EVENTUAL consistency (and |
| 13 |
# without any precedent AFTER transaction), it will be |
| 14 |
# allowed to execute since there are nothing to wait for. |
| 15 |
# 04. Resume the plugin stop. |
| 16 |
# 05. Clean up. |
| 17 |
################################################################################ |
| 18 |
|
| 19 |
--source include/have_debug_sync.inc |
| 20 |
--source include/have_group_replication_plugin.inc |
| 21 |
--let $rpl_skip_group_replication_start= 1 |
| 22 |
--source include/group_replication.inc |
| 23 |
|
| 24 |
--echo |
| 25 |
--echo ############################################################ |
| 26 |
--echo # 01. Bootstrap the group on server1. |
| 27 |
--echo # Stop it making it to block just before leave the group. |
| 28 |
--let $rpl_connection_name= server_1 |
| 29 |
--source include/rpl_connection.inc |
| 30 |
|
| 31 |
CREATE TABLE t1 (c1 INT PRIMARY KEY); |
| 32 |
--source include/start_and_bootstrap_group_replication.inc |
| 33 |
|
| 34 |
SET @@GLOBAL.DEBUG= '+d,group_replication_hold_stop_before_leave_the_group'; |
| 35 |
--send STOP GROUP_REPLICATION |
| 36 |
|
| 37 |
--let $rpl_connection_name= server1 |
| 38 |
--source include/rpl_connection.inc |
| 39 |
--let $wait_condition=SELECT COUNT(*)=1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE State='debug sync point: now' AND Info='STOP GROUP_REPLICATION' |
| 40 |
--source include/wait_condition.inc |
| 41 |
|
| 42 |
|
| 43 |
--echo |
| 44 |
--echo ############################################################ |
| 45 |
--echo # 02. Execute transaction T1 with BEFORE consistency, it |
| 46 |
--echo # will not be allowed to execute since plugin is stopping, |
| 47 |
--echo # otherwise there may be a deadlock on the waiting conditions. |
| 48 |
--let $rpl_connection_name= server1 |
| 49 |
--source include/rpl_connection.inc |
| 50 |
SET @@SESSION.group_replication_consistency= 'BEFORE'; |
| 51 |
--error ER_GRP_TRX_CONSISTENCY_BEGIN_NOT_ALLOWED |
| 52 |
SELECT * FROM t1; |
| 53 |
|
| 54 |
|
| 55 |
--echo |
| 56 |
--echo ############################################################ |
| 57 |
--echo # 03. Execute transaction T1 with EVENTUAL consistency (and |
| 58 |
--echo # without any precedent AFTER transaction), it will be |
| 59 |
--echo # allowed to execute since there are nothing to wait for. |
| 60 |
--let $rpl_connection_name= server1 |
| 61 |
--source include/rpl_connection.inc |
| 62 |
SET @@SESSION.group_replication_consistency= 'EVENTUAL'; |
| 63 |
SELECT * FROM t1; |
| 64 |
|
| 65 |
|
| 66 |
--echo |
| 67 |
--echo ############################################################ |
| 68 |
--echo # 04. Resume the plugin stop. |
| 69 |
--let $rpl_connection_name= server_1_1 |
| 70 |
--source include/rpl_connection.inc |
| 71 |
SET DEBUG_SYNC= "now SIGNAL signal.resume_stop_before_leave_the_group"; |
| 72 |
SET @@GLOBAL.DEBUG= '-d,group_replication_hold_stop_before_leave_the_group'; |
| 73 |
|
| 74 |
--let $rpl_connection_name= server_1 |
| 75 |
--source include/rpl_connection.inc |
| 76 |
--reap |
| 77 |
|
| 78 |
--let $group_replication_member_state= OFFLINE |
| 79 |
--source include/gr_wait_for_member_state.inc |
| 80 |
--source include/assert_and_disable_read_only.inc |
| 81 |
|
| 82 |
|
| 83 |
--echo |
| 84 |
--echo ############################################################ |
| 85 |
--echo # 05. Clean up. |
| 86 |
--let $rpl_connection_name= server1 |
| 87 |
--source include/rpl_connection.inc |
| 88 |
SET @@SESSION.group_replication_consistency= DEFAULT; |
| 89 |
DROP TABLE t1; |
| 90 |
|
| 91 |
--source include/group_replication_end.inc |