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>
		
			
				
	
	
		
			78 lines
		
	
	
	
		
			972 B
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			78 lines
		
	
	
	
		
			972 B
		
	
	
	
		
			Text
		
	
	
	
	
	
| connection node_2;
 | |
| connection node_1;
 | |
| 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);
 | |
| INSERT INTO t1 VALUES (11),(12),(13),(14),(15),(16),(17),(18),(19),(20);
 | |
| ERROR 23000: Duplicate entry '11' for key 'PRIMARY'
 | |
| INSERT INTO t1 VALUES (31),(32),(33);
 | |
| SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log;
 | |
| COUNT(*) = 0
 | |
| 0
 | |
| connection node_1;
 | |
| SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log;
 | |
| COUNT(*) = 0
 | |
| 0
 | |
| COMMIT;
 | |
| connection node_2;
 | |
| COMMIT;
 | |
| SELECT * FROM t1;
 | |
| f1
 | |
| 1
 | |
| 2
 | |
| 3
 | |
| 4
 | |
| 5
 | |
| 6
 | |
| 7
 | |
| 8
 | |
| 9
 | |
| 10
 | |
| 11
 | |
| 12
 | |
| 13
 | |
| 14
 | |
| 15
 | |
| 16
 | |
| 17
 | |
| 18
 | |
| 19
 | |
| 20
 | |
| 31
 | |
| 32
 | |
| 33
 | |
| connection node_1;
 | |
| SELECT * FROM t1;
 | |
| f1
 | |
| 1
 | |
| 2
 | |
| 3
 | |
| 4
 | |
| 5
 | |
| 6
 | |
| 7
 | |
| 8
 | |
| 9
 | |
| 10
 | |
| 11
 | |
| 12
 | |
| 13
 | |
| 14
 | |
| 15
 | |
| 16
 | |
| 17
 | |
| 18
 | |
| 19
 | |
| 20
 | |
| 31
 | |
| 32
 | |
| 33
 | |
| DROP TABLE t1;
 |