mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-31 02:46:29 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			89 lines
		
	
	
	
		
			3.3 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			89 lines
		
	
	
	
		
			3.3 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
| #
 | |
| # This test tests that one successful node wins over two nodes that fail for
 | |
| # different reasons
 | |
| #
 | |
| --source include/galera_cluster.inc
 | |
| --source include/have_innodb.inc
 | |
| 
 | |
| --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 suite/galera/include/auto_increment_offset_save.inc
 | |
| 
 | |
| # create inconsistency on node 2
 | |
| --connection node_2
 | |
| SET GLOBAL wsrep_on=OFF;
 | |
| DROP SCHEMA test;
 | |
| 
 | |
| # create inconsistency on node 3
 | |
| --connection node_3
 | |
| SET GLOBAL wsrep_on=OFF;
 | |
| CREATE TABLE t1 (f1 INTEGER);
 | |
| 
 | |
| --connection node_1
 | |
| CREATE TABLE t1 (f1 INTEGER);
 | |
| 
 | |
| # check that nodes 2 and 3 leave the cluster, and node_1 is Primary by itself
 | |
| 
 | |
| --connection node_1
 | |
| 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
 | |
| 
 | |
| --connection node_2
 | |
| SET SESSION wsrep_sync_wait=0;
 | |
| --let $wait_condition = SELECT VARIABLE_VALUE = 'Disconnected' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
 | |
| --source include/wait_condition.inc
 | |
| 
 | |
| --connection node_3
 | |
| SET SESSION wsrep_sync_wait=0;
 | |
| --let $wait_condition = SELECT VARIABLE_VALUE = 'Disconnected' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
 | |
| --source include/wait_condition.inc
 | |
| 
 | |
| --connection node_1
 | |
| # this is a workaround for "sending install message failed" BUG:
 | |
| # https://github.com/codership/galera/issues/174
 | |
| # When it happens, node_1 becomes non-prim
 | |
| SET GLOBAL wsrep_provider_options='pc.bootstrap=YES';
 | |
| --let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
 | |
| --source include/wait_condition.inc
 | |
| 
 | |
| # restart nodes 2 and 3, since they failed
 | |
| 
 | |
| --connection node_2
 | |
| # need to reinitialize connection due to a "Bad handshake" bug.
 | |
| # we reconnect using the 'mysql' database as 'test' was dropped.
 | |
| --disconnect node_2
 | |
| --connect node_2, 127.0.0.1, root, , mysql, $NODE_MYPORT_2
 | |
|  --source include/restart_mysqld.inc
 | |
| 
 | |
| --connection node_3
 | |
|  --source include/restart_mysqld.inc
 | |
| 
 | |
| --connection node_1
 | |
| --let $wait_condition = SELECT VARIABLE_VALUE = 3 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
 | |
| 
 | |
| DROP TABLE test.t1;
 | |
| 
 | |
| --source suite/galera/include/auto_increment_offset_restore.inc
 | |
| 
 | |
| --connection node_2
 | |
| CALL mtr.add_suppression("Inconsistent by consensus\\.");
 | |
| CALL mtr.add_suppression("Error_code: 1049");
 | |
| CALL mtr.add_suppression("WSREP: Failed to apply trx: source: ");
 | |
| CALL mtr.add_suppression("WSREP: Failed to apply app buffer");
 | |
| CALL mtr.add_suppression("WSREP: Node consistency compromized, leaving cluster\\.\\.\\.");
 | |
| 
 | |
| --connection node_3
 | |
| CALL mtr.add_suppression("Inconsistent by consensus\\.");
 | |
| CALL mtr.add_suppression("Error_code: 1050");
 | |
| CALL mtr.add_suppression("WSREP: Failed to apply trx: source: ");
 | |
| CALL mtr.add_suppression("WSREP: Failed to apply app buffer");
 | |
| CALL mtr.add_suppression("WSREP: Node consistency compromized, leaving cluster\\.\\.\\.");
 | 
