| 1 |
# |
| 2 |
# Check that server can be shut down in non-primary configuration. |
| 3 |
# |
| 4 |
|
| 5 |
--source include/galera_cluster.inc |
| 6 |
--source include/have_innodb.inc |
| 7 |
|
| 8 |
--let $node_1 = node_1 |
| 9 |
--let $node_2 = node_2 |
| 10 |
--source include/auto_increment_offset_save.inc |
| 11 |
|
| 12 |
--connection node_1 |
| 13 |
# Set higher weight for node_1 to keep it in primary |
| 14 |
# while node_2 is isolated. |
| 15 |
SET GLOBAL wsrep_provider_options = 'pc.weight=2'; |
| 16 |
|
| 17 |
--connection node_2 |
| 18 |
# Isolate node_2 from the group and wait until wsrep_ready becomes OFF. |
| 19 |
SET SESSION wsrep_sync_wait = 0; |
| 20 |
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1'; |
| 21 |
|
| 22 |
--connection node_1 |
| 23 |
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; |
| 24 |
--source include/wait_condition.inc |
| 25 |
|
| 26 |
--connection node_2 |
| 27 |
--let $wait_condition = SELECT VARIABLE_VALUE = 'OFF' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready' |
| 28 |
--source include/wait_condition.inc |
| 29 |
SHOW STATUS LIKE 'wsrep_cluster_status'; |
| 30 |
# Verify that graceful shutdown succeeds. |
| 31 |
--source include/shutdown_mysqld.inc |
| 32 |
|
| 33 |
--source include/start_mysqld.inc |
| 34 |
|
| 35 |
--connection node_1 |
| 36 |
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; |
| 37 |
--source include/wait_condition.inc |
| 38 |
|
| 39 |
# Restore original settings. |
| 40 |
SET GLOBAL wsrep_provider_options = 'pc.weight = 1'; |
| 41 |
|
| 42 |
--source include/auto_increment_offset_restore.inc |