mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-31 02:46:29 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			56 lines
		
	
	
	
		
			2.5 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			56 lines
		
	
	
	
		
			2.5 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
| # This tests proper desync counter cleanup when DONOR/DESYNC state is cleared.
 | |
| 
 | |
| --source include/galera_cluster.inc
 | |
| --source include/have_innodb.inc
 | |
| 
 | |
| # Make node 1 tolerate split-brain
 | |
| SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
 | |
| 
 | |
| # Desync and disconnect node 2 from the PC:
 | |
| --connection node_2
 | |
| SET @@global.wsrep_desync = 1;
 | |
| SET SESSION wsrep_dirty_reads=1;
 | |
| SET SESSION wsrep_sync_wait=0;
 | |
| SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
 | |
| --let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
 | |
| --source include/wait_condition.inc
 | |
| 
 | |
| # Wait until node 2 disappears from the PC:
 | |
| --connection node_1
 | |
| --let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
 | |
| --source include/wait_condition.inc
 | |
| --let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
 | |
| --source include/wait_condition.inc
 | |
| 
 | |
| # Modify app state to force node 2 into PRIMARY upon reconnection.
 | |
| CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
 | |
| 
 | |
| # Reconnect node 2 to the PC:
 | |
| --connection node_2
 | |
| SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
 | |
| SET wsrep_dirty_reads=0;
 | |
| --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 = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
 | |
| --source include/wait_condition.inc
 | |
| --let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
 | |
| --source include/wait_condition.inc
 | |
| 
 | |
| # Must return 0:
 | |
| SHOW STATUS LIKE 'wsrep_desync_count';
 | |
| 
 | |
| # Resync node_2, should pass:
 | |
| SET @@global.wsrep_desync = 0;
 | |
| 
 | |
| --let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
 | |
| --source include/wait_condition.inc
 | |
| 
 | |
| SET SESSION wsrep_sync_wait=15;
 | |
| SHOW CREATE TABLE t1;
 | |
| DROP TABLE t1;
 | |
| CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender .+ ?is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");
 | |
| 
 | |
| --connection node_1
 | |
| --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 = 'pc.ignore_sb=false';
 | 
