mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-31 15:50:51 +03:00 
			
		
		
		
	In Mariabackup, we would want the backed-up redo log file size to be a multiple of 512 bytes, or OS_FILE_LOG_BLOCK_SIZE. However, at startup, InnoDB would be picky, requiring the file size to be a multiple of innodb_page_size. Furthermore, InnoDB would require the parameter to be a multiple of one megabyte, while the minimum granularity is 512 bytes. Because the data-file-oriented fil_io() API is being used for writing the InnoDB redo log, writes will for now require innodb_log_file_size to be a multiple of the maximum innodb_page_size (65536 bytes). To complicate matters, InnoDB startup divided srv_log_file_size by UNIV_PAGE_SIZE, so that initially, the unit was bytes, and later it was innodb_page_size. We will simplify this and keep srv_log_file_size in bytes at all times. innobase_log_file_size: Remove. Remove some obsolete checks against overflow on 32-bit systems. srv_log_file_size is always 64 bits, and the maximum size 512GiB in multiples of innodb_page_size always fits in ulint (which is 32 or 64 bits). 512GiB would be 8,388,608*64KiB or 134,217,728*4KiB. log_init(): Remove the parameter file_size that was always passed as srv_log_file_size. log_set_capacity(): Add a parameter for passing the requested file size. srv_log_file_size_requested: Declare static in srv0start.cc. create_log_file(), create_log_files(), innobase_start_or_create_for_mysql(): Invoke fil_node_create() with srv_log_file_size expressed in multiples of innodb_page_size. innobase_start_or_create_for_mysql(): Require the redo log file sizes to be multiples of 512 bytes.
		
			
				
	
	
		
			231 lines
		
	
	
		
			8.9 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			231 lines
		
	
	
		
			8.9 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| --echo # Testcase for the following bugs
 | |
| --echo # Bug#16691130 - ASSERT WHEN INNODB_LOG_GROUP_HOME_DIR DOES NOT EXIST
 | |
| --echo # Bug#16418661 - CHANGING NAME IN FOR INNODB_DATA_FILE_PATH SHOULD NOT SUCCEED WITH LOG FILES
 | |
| 
 | |
| --source include/have_innodb.inc
 | |
| 
 | |
| --disable_query_log
 | |
| call mtr.add_suppression("InnoDB: Could not create undo tablespace.*undo002");
 | |
| call mtr.add_suppression("InnoDB: InnoDB Database creation was aborted");
 | |
| call mtr.add_suppression("Plugin 'InnoDB' init function returned error");
 | |
| call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
 | |
| call mtr.add_suppression("InnoDB: Operating system error number \d+ in a file operation");
 | |
| call mtr.add_suppression("InnoDB: The error means the system cannot find the path specified");
 | |
| call mtr.add_suppression("InnoDB: If you are installing InnoDB, remember that you must create directories yourself");
 | |
| call mtr.add_suppression("InnoDB: File .path.to.non-existent.ib_logfile101: 'create' returned OS error \d+");
 | |
| call mtr.add_suppression("InnoDB: Cannot create .path.to.non-existent.ib_logfile101");
 | |
| call mtr.add_suppression("InnoDB: The innodb_system data file 'ibdata1' was not found but one of the other data files 'ibdata2' exists");
 | |
| call mtr.add_suppression("InnoDB: Tablespace size stored in header is \d+ pages, but the sum of data file sizes is \d+ pages");
 | |
| call mtr.add_suppression("InnoDB: Cannot start InnoDB. The tail of the system tablespace is missing");
 | |
| call mtr.add_suppression("InnoDB: undo tablespace '.*undo001' exists\. Creating system tablespace with existing undo tablespaces is not supported\. Please delete all undo tablespaces before creating new system tablespace\.");
 | |
| call mtr.add_suppression("");
 | |
| call mtr.add_suppression("");
 | |
| --enable_query_log
 | |
| 
 | |
| let bugdir= $MYSQLTEST_VARDIR/tmp/log_file;
 | |
| --mkdir $bugdir
 | |
| 
 | |
| let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
 | |
| let $check_no_innodb=SELECT * FROM INFORMATION_SCHEMA.ENGINES
 | |
| WHERE engine = 'innodb'
 | |
| AND support IN ('YES', 'DEFAULT', 'ENABLED');
 | |
| 
 | |
| let $check_yes_innodb=SELECT COUNT(*) `1` FROM INFORMATION_SCHEMA.ENGINES
 | |
| WHERE engine='innodb'
 | |
| AND support IN ('YES', 'DEFAULT', 'ENABLED');
 | |
| 
 | |
| --let $ibp=--innodb-log-files-in-group=3 --innodb-log-group-home-dir=$bugdir
 | |
| --let $ibp=$ibp --innodb-data-home-dir=$bugdir --innodb-undo-directory=$bugdir
 | |
| --let $ibp=$ibp --innodb-undo-logs=20 --innodb-undo-tablespaces=3
 | |
| --let $ibp=$ibp --innodb-data-file-path=ibdata1:16M;ibdata2:10M:autoextend
 | |
| 
 | |
| --echo # Start mysqld without the possibility to create innodb_undo_tablespaces
 | |
| --let $restart_parameters= $ibp
 | |
| --mkdir $bugdir/undo002
 | |
| --source include/restart_mysqld.inc
 | |
| eval $check_no_innodb;
 | |
| --source include/shutdown_mysqld.inc
 | |
| 
 | |
| let SEARCH_PATTERN=\[ERROR\] InnoDB: Could not create undo tablespace '.*undo002';
 | |
| --source include/search_pattern_in_file.inc
 | |
| 
 | |
| --echo # Remove  undo001,undo002,ibdata1,ibdata2,ib_logfile1,ib_logfile2,ib_logfile101
 | |
| --remove_file $bugdir/undo001
 | |
| --rmdir $bugdir/undo002
 | |
| --remove_file $bugdir/ibdata1
 | |
| --remove_file $bugdir/ibdata2
 | |
| --remove_file $bugdir/ib_logfile1
 | |
| --remove_file $bugdir/ib_logfile2
 | |
| --remove_file $bugdir/ib_logfile101
 | |
| --list_files $bugdir
 | |
| 
 | |
| --echo # Start mysqld with non existent innodb_log_group_home_dir
 | |
| --let $restart_parameters= $ibp --innodb_log_group_home_dir=/path/to/non-existent/
 | |
| --source include/start_mysqld.inc
 | |
| eval $check_no_innodb;
 | |
| --source include/shutdown_mysqld.inc
 | |
| let SEARCH_PATTERN=File .path.to.non-existent.*ib_logfile101: 'create' returned OS error \d+;
 | |
| --source include/search_pattern_in_file.inc
 | |
| 
 | |
| --echo # Remove ibdata1 & ibdata2
 | |
| --remove_file $bugdir/ibdata1
 | |
| --remove_file $bugdir/ibdata2
 | |
| --list_files $bugdir
 | |
| 
 | |
| --echo # Successfully let InnoDB create tablespaces
 | |
| --let $restart_parameters= $ibp
 | |
| --source include/start_mysqld.inc
 | |
| eval $check_yes_innodb;
 | |
| --source include/shutdown_mysqld.inc
 | |
| 
 | |
| --echo # Backup tmp/logfile/*
 | |
| --copy_file $bugdir/ibdata1 $bugdir/bak_ibdata1
 | |
| --copy_file $bugdir/ibdata2 $bugdir/bak_ibdata2
 | |
| --copy_file $bugdir/ib_logfile0 $bugdir/bak_ib_logfile0
 | |
| --copy_file $bugdir/ib_logfile1 $bugdir/bak_ib_logfile1
 | |
| --copy_file $bugdir/ib_logfile2 $bugdir/bak_ib_logfile2
 | |
| --copy_file $bugdir/undo001 $bugdir/bak_undo001
 | |
| --copy_file $bugdir/undo002 $bugdir/bak_undo002
 | |
| --copy_file $bugdir/undo003 $bugdir/bak_undo003
 | |
| 
 | |
| --echo # 1. With ibdata2, Without ibdata1
 | |
| --remove_file $bugdir/ibdata1
 | |
| 
 | |
| --source include/start_mysqld.inc
 | |
| eval $check_no_innodb;
 | |
| --source include/shutdown_mysqld.inc
 | |
| let SEARCH_PATTERN=The innodb_system data file 'ibdata1' was not found but one of the other data files 'ibdata2' exists;
 | |
| --source include/search_pattern_in_file.inc
 | |
| 
 | |
| # clean up & Restore
 | |
| --source ../include/log_file_cleanup.inc
 | |
| 
 | |
| --echo # 2. With ibdata1, without ibdata2
 | |
| --remove_file $bugdir/ibdata2
 | |
| --source include/start_mysqld.inc
 | |
| eval $check_no_innodb;
 | |
| --source include/shutdown_mysqld.inc
 | |
| let SEARCH_PATTERN=InnoDB: Tablespace size stored in header is \d+ pages, but the sum of data file sizes is \d+ pages;
 | |
| --source include/search_pattern_in_file.inc
 | |
| let SEARCH_PATTERN=InnoDB: Cannot start InnoDB. The tail of the system tablespace is missing;
 | |
| --source include/search_pattern_in_file.inc
 | |
| 
 | |
| # clean up & Restore
 | |
| --source ../include/log_file_cleanup.inc
 | |
| 
 | |
| --echo # 3. Without ibdata1 & ibdata2
 | |
| --remove_file $bugdir/ibdata1
 | |
| --remove_file $bugdir/ibdata2
 | |
| --list_files $bugdir
 | |
| --source include/start_mysqld.inc
 | |
| eval $check_no_innodb;
 | |
| --source include/shutdown_mysqld.inc
 | |
| let SEARCH_PATTERN=InnoDB: undo tablespace .*undo001.* exists\. Creating system tablespace with existing undo tablespaces is not supported\. Please delete all undo tablespaces before creating new system tablespace\.;
 | |
| --source include/search_pattern_in_file.inc
 | |
| 
 | |
| # clean up & Restore
 | |
| --source ../include/log_file_cleanup.inc
 | |
| 
 | |
| --echo # 4. Without ibdata*, ib_logfile* and with undo00*
 | |
| --remove_files_wildcard $bugdir ibdata*
 | |
| --remove_files_wildcard $bugdir ib_logfile*
 | |
| --list_files $bugdir
 | |
| --source include/start_mysqld.inc
 | |
| eval $check_no_innodb;
 | |
| --source include/shutdown_mysqld.inc
 | |
| 
 | |
| # clean up & Restore
 | |
| --source ../include/log_file_cleanup.inc
 | |
| 
 | |
| --echo # 5. Without ibdata*,ib_logfile* files & Without undo002
 | |
| --remove_files_wildcard $bugdir ibdata*
 | |
| --remove_files_wildcard $bugdir ib_logfile*
 | |
| --remove_file $bugdir/undo002
 | |
| --list_files $bugdir
 | |
| --source include/start_mysqld.inc
 | |
| eval $check_no_innodb;
 | |
| --source include/shutdown_mysqld.inc
 | |
| 
 | |
| # clean up & Restore
 | |
| --source ../include/log_file_cleanup.inc
 | |
| 
 | |
| --echo # 6. Without ibdata*,ib_logfile* files & Without undo001, undo002
 | |
| # and with undo003
 | |
| --remove_files_wildcard $bugdir ibdata*
 | |
| --remove_files_wildcard $bugdir ib_logfile*
 | |
| --remove_file $bugdir/undo001
 | |
| --remove_file $bugdir/undo002
 | |
| --list_files $bugdir
 | |
| --source include/start_mysqld.inc
 | |
| eval $check_no_innodb;
 | |
| --source include/shutdown_mysqld.inc
 | |
| let SEARCH_PATTERN=undo tablespace .*undo003.* exists\. Creating system tablespace with existing undo tablespaces is not supported\. Please delete all undo tablespaces before creating new system tablespace\.;
 | |
| --source include/search_pattern_in_file.inc
 | |
| 
 | |
| # clean up & Restore
 | |
| --source ../include/log_file_cleanup.inc
 | |
| 
 | |
| --echo # 7. With ibdata files & Without undo002
 | |
| --remove_file $bugdir/undo002
 | |
| --list_files $bugdir
 | |
| --source include/start_mysqld.inc
 | |
| eval $check_no_innodb;
 | |
| --source include/shutdown_mysqld.inc
 | |
| let SEARCH_PATTERN=InnoDB: Unable to open undo tablespace.*undo002;
 | |
| --source include/search_pattern_in_file.inc
 | |
| # clean up & Restore
 | |
| --source ../include/log_file_cleanup.inc
 | |
| 
 | |
| --echo # 8. With ibdata files & Without undo001, undo002
 | |
| --remove_file $bugdir/undo001
 | |
| --remove_file $bugdir/undo002
 | |
| --list_files $bugdir
 | |
| --source include/start_mysqld.inc
 | |
| eval $check_no_innodb;
 | |
| --source include/shutdown_mysqld.inc
 | |
| let SEARCH_PATTERN=InnoDB: Unable to open undo tablespace.*undo001;
 | |
| --source include/search_pattern_in_file.inc
 | |
| 
 | |
| # clean up & Restore
 | |
| --source ../include/log_file_cleanup.inc
 | |
| 
 | |
| --echo # 9. Without ibdata*, without undo*, Without ib_logfile1 and with ib_logfile2
 | |
| --remove_files_wildcard $bugdir ibdata*
 | |
| --remove_files_wildcard $bugdir undo00*
 | |
| --remove_file $bugdir/ib_logfile1
 | |
| --list_files $bugdir
 | |
| --source include/start_mysqld.inc
 | |
| eval $check_no_innodb;
 | |
| --source include/shutdown_mysqld.inc
 | |
| let SEARCH_PATTERN=redo log file .*ib_logfile0.* exists\. Creating system tablespace with existing redo log files is not recommended\. Please delete all redo log files before creating new system tablespace\.;
 | |
| --source include/search_pattern_in_file.inc
 | |
| 
 | |
| # clean up & Restore
 | |
| --source ../include/log_file_cleanup.inc
 | |
| 
 | |
| --echo # 10. With ibdata*, without ib_logfile0
 | |
| --remove_file $bugdir/ib_logfile0
 | |
| 
 | |
| --source include/start_mysqld.inc
 | |
| eval $check_no_innodb;
 | |
| --source include/shutdown_mysqld.inc
 | |
| 
 | |
| --source ../include/log_file_cleanup.inc
 | |
| 
 | |
| --echo # 11. With ibdata*, without ib_logfile1
 | |
| --remove_file $bugdir/ib_logfile1
 | |
| --list_files $bugdir
 | |
| --source include/start_mysqld.inc
 | |
| eval $check_yes_innodb;
 | |
| --source include/shutdown_mysqld.inc
 | |
| --let SEARCH_PATTERN=Resizing redo log from 1\*\d+ to 3\*\d+ bytes; LSN=\d+
 | |
| --source include/search_pattern_in_file.inc
 | |
| 
 | |
| --let $restart_parameters=
 | |
| --source include/start_mysqld.inc
 | |
| 
 | |
| --echo # Cleanup
 | |
| --list_files $bugdir
 | |
| --remove_files_wildcard $bugdir
 | |
| --rmdir $bugdir
 |