| 1 |
# |
| 2 |
# Check the handling of @@wsrep_cluster_address |
| 3 |
# |
| 4 |
|
| 5 |
--source include/galera_cluster.inc |
| 6 |
--source include/have_innodb.inc |
| 7 |
|
| 8 |
# Save original auto_increment_offset values. |
| 9 |
--let $node_1=node_1 |
| 10 |
--let $node_2=node_2 |
| 11 |
--source include/auto_increment_offset_save.inc |
| 12 |
|
| 13 |
# |
| 14 |
# Set to invalid value |
| 15 |
# |
| 16 |
|
| 17 |
--connection node_2 |
| 18 |
--let $wsrep_cluster_address_node2 = `SELECT @@wsrep_cluster_address` |
| 19 |
SET GLOBAL wsrep_cluster_address = 'foo://'; |
| 20 |
|
| 21 |
# With wsrep_sync_wait, this returns an error |
| 22 |
--error ER_LOCK_WAIT_TIMEOUT |
| 23 |
SHOW STATUS; |
| 24 |
|
| 25 |
SET SESSION wsrep_sync_wait=0; |
| 26 |
|
| 27 |
SELECT COUNT(*) > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS; |
| 28 |
|
| 29 |
# Must return 'OFF' |
| 30 |
SHOW STATUS LIKE 'wsrep_ready'; |
| 31 |
|
| 32 |
# Must return 'Disconnected' |
| 33 |
SHOW STATUS LIKE 'wsrep_cluster_status'; |
| 34 |
|
| 35 |
# Must return 0 = 'Initialized' |
| 36 |
SHOW STATUS LIKE 'wsrep_local_state'; |
| 37 |
SHOW STATUS LIKE 'wsrep_local_state_comment'; |
| 38 |
|
| 39 |
--connection node_1 |
| 40 |
--sleep 1 |
| 41 |
# Node #1 thinks that it is now part of a single-node primary cluster |
| 42 |
SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; |
| 43 |
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; |
| 44 |
|
| 45 |
# |
| 46 |
# Reset everything as it was |
| 47 |
# |
| 48 |
|
| 49 |
--connection node_2 |
| 50 |
--disable_query_log |
| 51 |
--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_node2'; |
| 52 |
--source include/galera_wait_ready.inc |
| 53 |
--enable_query_log |
| 54 |
|
| 55 |
--connection node_1 |
| 56 |
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; |
| 57 |
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; |
| 58 |
|
| 59 |
--connection node_2 |
| 60 |
CALL mtr.add_suppression("Backend not supported: foo"); |
| 61 |
CALL mtr.add_suppression("Failed to initialize backend using 'foo"); |
| 62 |
CALL mtr.add_suppression("Failed to open channel 'my_wsrep_cluster' at 'foo"); |
| 63 |
CALL mtr.add_suppression("gcs connect failed: Socket type not supported"); |
| 64 |
CALL mtr.add_suppression("wsrep::connect\\(\\) failed: 7"); |
| 65 |
CALL mtr.add_suppression("gcs_caused\\(\\) returned -[0-9]+ \\(Software caused connection abort\\)"); |
| 66 |
CALL mtr.add_suppression("failed to open gcomm backend connection: 110: failed to reach primary view: 110"); |
| 67 |
CALL mtr.add_suppression("Failed to open backend connection: -110 \\(Connection timed out\\)"); |
| 68 |
CALL mtr.add_suppression("gcs connect failed: Connection timed out"); |
| 69 |
CALL mtr.add_suppression("WSREP: wsrep::connect\\(foo://\\) failed: 7"); |
| 70 |
CALL mtr.add_suppression("WSREP: wsrep::connect\\(gcomm://.*\\) failed: 7"); |
| 71 |
|
| 72 |
# Restore original auto_increment_offset values. |
| 73 |
--source include/auto_increment_offset_restore.inc |
| 74 |
|
| 75 |
--source include/galera_end.inc |
| 76 |
--echo # End of test |