mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-31 10:56:12 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			123 lines
		
	
	
	
		
			4.5 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			123 lines
		
	
	
	
		
			4.5 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
| #
 | |
| # Test the operation of pc.bootstrap 
 | |
| #
 | |
| --source include/big_test.inc
 | |
| --source include/galera_cluster.inc
 | |
| --source include/have_innodb.inc
 | |
| 
 | |
| call mtr.add_suppression("WSREP: gcs/src/gcs_core\\.cpp:core_handle_uuid_msg\\(\\)");
 | |
| 
 | |
| #
 | |
| # Create connection node_3 and save auto increment variables.
 | |
| #
 | |
| --let $galera_connection_name = node_3
 | |
| --let $galera_server_number = 3
 | |
| --source include/galera_connect.inc
 | |
| 
 | |
| --let $node_1 = node_1
 | |
| --let $node_2 = node_2
 | |
| --let $node_3 = node_3
 | |
| --source ../galera/include/auto_increment_offset_save.inc
 | |
| 
 | |
| --connection node_1
 | |
| 
 | |
| CREATE TABLE t1 (f1 INTEGER);
 | |
| 
 | |
| SET SESSION wsrep_sync_wait=0;
 | |
| --let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
 | |
| --source include/wait_condition.inc
 | |
| 
 | |
| # Force all nodes to become non-primary
 | |
| 
 | |
| SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
 | |
| 
 | |
| --connection node_2
 | |
| SET SESSION wsrep_sync_wait=0;
 | |
| --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
 | |
| --source include/wait_condition.inc
 | |
| 
 | |
| SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
 | |
| 
 | |
| --connection node_3
 | |
| SET SESSION wsrep_sync_wait=0;
 | |
| --let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
 | |
| --source include/wait_condition.inc
 | |
| 
 | |
| SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
 | |
| 
 | |
| # Node #3 should be non-primary
 | |
| --let $wait_condition = SELECT variable_value = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE variable_name = 'wsrep_cluster_status';
 | |
| --source include/wait_condition.inc
 | |
| 
 | |
| --connection node_2
 | |
| # Node #2 should be non-primary
 | |
| --let $wait_condition = SELECT variable_value = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE variable_name = 'wsrep_cluster_status';
 | |
| --source include/wait_condition.inc
 | |
| 
 | |
| # Signal node #2 to bootstrap
 | |
| SET GLOBAL wsrep_provider_options = 'pc.bootstrap=1';
 | |
| 
 | |
| # Wait until node becomes available for queries again
 | |
| --source include/wait_until_connected_again.inc
 | |
| 
 | |
| # Node #2 should now be a primary of a 1-node cluster
 | |
| 
 | |
| SHOW STATUS LIKE 'wsrep_cluster_size';
 | |
| SHOW STATUS LIKE 'wsrep_cluster_status';
 | |
| 
 | |
| # Perform an insert on node #2
 | |
| INSERT INTO t1 VALUES (1);
 | |
| 
 | |
| # Reconnect all nodes 
 | |
| --connection node_2
 | |
| SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
 | |
| 
 | |
| --source include/wait_until_connected_again.inc
 | |
| --let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
 | |
| --source include/wait_condition.inc
 | |
| --let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
 | |
| --source include/wait_condition.inc
 | |
| --let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
 | |
| --source include/wait_condition.inc
 | |
| 
 | |
| 
 | |
| --connection node_1
 | |
| SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
 | |
| --source include/wait_until_connected_again.inc
 | |
| --let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
 | |
| --source include/wait_condition.inc
 | |
| --let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
 | |
| --source include/wait_condition.inc
 | |
| --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
 | |
| --source include/wait_condition.inc
 | |
| 
 | |
| 
 | |
| --connection node_3
 | |
| SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
 | |
| 
 | |
| --source include/wait_until_connected_again.inc
 | |
| --let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
 | |
| --source include/wait_condition.inc
 | |
| --let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
 | |
| --source include/wait_condition.inc
 | |
| --let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
 | |
| --source include/wait_condition.inc
 | |
| 
 | |
| # Check that all nodes have the same view of the database
 | |
| 
 | |
| --connection node_1
 | |
| SELECT COUNT(*) FROM t1;
 | |
| 
 | |
| --connection node_2
 | |
| SELECT COUNT(*) FROM t1;
 | |
| 
 | |
| --connection node_3
 | |
| SELECT COUNT(*) FROM t1;
 | |
| 
 | |
| # Test cleanup
 | |
| DROP TABLE t1;
 | |
| 
 | |
| #
 | |
| # Restore auto increment variables.
 | |
| #
 | |
| --source ../galera/include/auto_increment_offset_restore.inc
 | 
