| 1 |
# |
| 2 |
# Test that node eviction event is generated in the status file. |
| 3 |
# |
| 4 |
|
| 5 |
--source include/big_test.inc |
| 6 |
--source include/galera_cluster.inc |
| 7 |
--source include/have_innodb.inc |
| 8 |
|
| 9 |
# Make sure that Galera library has node eviction event reporting. |
| 10 |
--let $galera_version=26.4.14 |
| 11 |
--source suite/wsrep/include/check_galera_version.inc |
| 12 |
|
| 13 |
--connection node_1 |
| 14 |
CALL mtr.add_suppression("\\[Warning\\] WSREP: evicting member .* ?at .+ permanently from group"); |
| 15 |
|
| 16 |
--connection node_2 |
| 17 |
CALL mtr.add_suppression("\\[Warning\\] WSREP: handshake with .* ?.+ failed: 'evicted'"); |
| 18 |
CALL mtr.add_suppression("\\[ERROR\\] WSREP: exception from gcomm, backend must be restarted: this node has been evicted out of the cluster, gcomm backend restart is required \\(FATAL\\)"); |
| 19 |
|
| 20 |
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 |
| 21 |
CALL mtr.add_suppression("\\[Warning\\] WSREP: evicting member .* ?at .+ permanently from group"); |
| 22 |
|
| 23 |
--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4 |
| 24 |
CALL mtr.add_suppression("\\[Warning\\] WSREP: evicting member .* ?at .+ permanently from group"); |
| 25 |
|
| 26 |
# Save original auto_increment_offset values. |
| 27 |
|
| 28 |
--let $node_1=node_1 |
| 29 |
--let $node_2=node_2 |
| 30 |
--let $node_3=node_3 |
| 31 |
--let $node_4=node_4 |
| 32 |
--source include/auto_increment_offset_save.inc |
| 33 |
|
| 34 |
# Repeatedly isolate the node from the cluster until it's evicted. |
| 35 |
|
| 36 |
--disable_query_log |
| 37 |
--disable_result_log |
| 38 |
|
| 39 |
--let $evicted = 0 |
| 40 |
while (!$evicted) |
| 41 |
{ |
| 42 |
--connection node_2 |
| 43 |
|
| 44 |
--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; |
| 45 |
--source include/wait_condition.inc |
| 46 |
|
| 47 |
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; |
| 48 |
--source include/wait_condition.inc |
| 49 |
|
| 50 |
--disable_query_log |
| 51 |
--disable_result_log |
| 52 |
|
| 53 |
SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; |
| 54 |
|
| 55 |
--connection node_1 |
| 56 |
--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; |
| 57 |
--source include/wait_condition.inc |
| 58 |
|
| 59 |
--disable_query_log |
| 60 |
--disable_result_log |
| 61 |
|
| 62 |
--connection node_2 |
| 63 |
SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; |
| 64 |
|
| 65 |
# As the cluster size doesn't change in case the node is evicted, there is |
| 66 |
# no good condition to wait for in case the eviction happens, so sleep a bit. |
| 67 |
|
| 68 |
--sleep 1 |
| 69 |
|
| 70 |
--connection node_1 |
| 71 |
--let $evicted = `SELECT VARIABLE_VALUE != '' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_evs_evict_list'` |
| 72 |
} |
| 73 |
|
| 74 |
--enable_query_log |
| 75 |
--enable_result_log |
| 76 |
|
| 77 |
--connection node_2 |
| 78 |
--source include/wsrep_wait_disconnect.inc |
| 79 |
SET GLOBAL wsrep_on = OFF; |
| 80 |
|
| 81 |
# Check the status file to contain the eviction event message. |
| 82 |
|
| 83 |
--let $assert_count = 1 |
| 84 |
--let $assert_file = $MYSQLTEST_VARDIR/mysqld.2/data/status2.json |
| 85 |
--let $assert_text = Node evicted |
| 86 |
--let $assert_select = "status": "evicted" |
| 87 |
--source include/assert_grep.inc |
| 88 |
|
| 89 |
# Re-join the node after restart. |
| 90 |
|
| 91 |
--source include/restart_mysqld.inc |
| 92 |
|
| 93 |
--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; |
| 94 |
--source include/wait_condition.inc |
| 95 |
|
| 96 |
--source include/auto_increment_offset_restore.inc |