mirror of
				https://github.com/MariaDB/server.git
				synced 2025-11-03 14:33:32 +03:00 
			
		
		
		
	BUG#39325 Server crash inside MYSQL_LOG::purge_first_log halts replicaiton
The patch reverses the order of the purging and updating events for log and
relay-log.info/index files respectively.
This solves the problem of having holes caused by crashes happening between updating
info/index files and purging logs.
This patch also contains an aditional test case for testing the crashing before purge logs.
      
NOTE1: This is a combined patch for BUG#38826 and BUG#39325. This patch is based on
bugteam tree and takes into account reviewers suggestions.
NOTE2: Merge from 5.0-bugteam
		
	
		
			
				
	
	
		
			41 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
flush logs;
 | 
						|
flush logs;
 | 
						|
flush logs;
 | 
						|
show binary logs;
 | 
						|
Log_name	File_size
 | 
						|
master-bin.000001	#
 | 
						|
master-bin.000002	#
 | 
						|
master-bin.000003	#
 | 
						|
master-bin.000004	#
 | 
						|
purge binary logs TO 'master-bin.000004';
 | 
						|
Warnings:
 | 
						|
Warning	1612	Being purged log MYSQLTEST_VARDIR/log/master-bin.000001 was not found
 | 
						|
*** must show a list starting from the 'TO' argument of PURGE ***
 | 
						|
show binary logs;
 | 
						|
Log_name	File_size
 | 
						|
master-bin.000004	#
 | 
						|
reset master;
 | 
						|
flush logs;
 | 
						|
flush logs;
 | 
						|
flush logs;
 | 
						|
*** must be a warning master-bin.000001 was not found ***
 | 
						|
Warnings:
 | 
						|
Warning	1612	Being purged log MYSQLTEST_VARDIR/log/master-bin.000001 was not found
 | 
						|
Warning	1612	Being purged log MYSQLTEST_VARDIR/log/master-bin.000001 was not found
 | 
						|
*** must show one record, of the active binlog, left in the index file after PURGE ***
 | 
						|
show binary logs;
 | 
						|
Log_name	File_size
 | 
						|
master-bin.000004	#
 | 
						|
reset master;
 | 
						|
flush logs;
 | 
						|
flush logs;
 | 
						|
flush logs;
 | 
						|
purge binary logs TO 'master-bin.000002';
 | 
						|
ERROR HY000: Fatal error during log purge
 | 
						|
show warnings;
 | 
						|
Level	Code	Message
 | 
						|
Error	1377	a problem with deleting MYSQLTEST_VARDIR/log/master-bin.000001; consider examining correspondence of your binlog index file to the actual binlog files
 | 
						|
Error	1377	Fatal error during log purge
 | 
						|
reset master;
 | 
						|
End of tests
 |