mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-31 02:46:29 +01:00 
			
		
		
		
	 b1b2689f17
			
		
	
	
	b1b2689f17
	
	
	
		
			
			This patch changes statement rollback for streaming replication. Previously, a statement rollback was turned into full transaction rollback in the case where the transaction had already replicated a fragment. This was introduced in the initial implementation of streaming replication due to the fact that we do not have a mechanism to perform a statement rollback on the applying side. This policy is however overly pessimistic, causing full rollbacks even in cases where a local statement rollback, would not require a statement rollback on the applying side. This happens to be case when the statement itself has not replicated any fragments. So the patch changes the condition that determines if a statement rollback should be turned into a full rollback accordingly. Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
		
			
				
	
	
		
			37 lines
		
	
	
	
		
			891 B
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			37 lines
		
	
	
	
		
			891 B
		
	
	
	
		
			Text
		
	
	
	
	
	
| #
 | |
| # GCF-609 SR: Assertion wsrep_apply_cb on slave after master causes a duplicate key error
 | |
| #
 | |
| 
 | |
| --source include/galera_cluster.inc
 | |
| 
 | |
| CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
 | |
| 
 | |
| --connection node_1
 | |
| SET SESSION wsrep_trx_fragment_size=1;
 | |
| SET AUTOCOMMIT=OFF;
 | |
| START TRANSACTION;
 | |
| INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
 | |
| 
 | |
| --connection node_2
 | |
| SET SESSION wsrep_trx_fragment_size=1;
 | |
| SET AUTOCOMMIT=OFF;
 | |
| START TRANSACTION;
 | |
| INSERT INTO t1 VALUES (11),(12),(13),(14),(15),(16),(17),(18),(19),(20);
 | |
| --error ER_DUP_ENTRY
 | |
| INSERT INTO t1 VALUES (11),(12),(13),(14),(15),(16),(17),(18),(19),(20);
 | |
| INSERT INTO t1 VALUES (31),(32),(33);
 | |
| 
 | |
| SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log;
 | |
| 
 | |
| --connection node_1
 | |
| SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log;
 | |
| COMMIT;
 | |
| 
 | |
| --connection node_2
 | |
| COMMIT;
 | |
| SELECT * FROM t1;
 | |
| 
 | |
| --connection node_1
 | |
| SELECT * FROM t1;
 | |
| 
 | |
| DROP TABLE t1;
 |