mirror of
https://github.com/MariaDB/server.git
synced 2025-02-10 07:34:11 +01:00
![Thirunarayanan Balathandayuthapani](/assets/img/avatar_default.png)
trx_sys_t::undo_log_nonempty: Set to true if there are undo logs to rollback and purge. The algorithm for re-creating the undo tablespace when trx_sys_t::undo_log_nonempty is disabled: 1) trx_sys_t::reset_page(): Reset the TRX_SYS page and assign all rollback segment slots from 1..127 to FIL_NULL 2) Free the rollback segment header page of system tablespace for the slots 1..127 3) Update the binlog and WSREP information in system tablespace rollback segment header Step (1), (2) and Step (3) should happen atomically within a single mini-transaction. 4) srv_undo_delete_old_tablespaces(): Delete the old undo tablespaces present in the undo log directory 5) Make checkpoint to get rid of old undo log tablespaces redo logs 6) Assign new start space id for the undo log tablespaces 7) Re-create the specified undo log tablespaces. InnoDB uses same mtr for this one and step (6) 8) Make checkpoint again, so that server or mariabackup can read the undo log tablespace page0 before applying the redo logs srv_undo_tablespaces_reinit(): Recreate the undo log tablespaces. It does reset trx_sys page, delete the old undo tablespaces, update the binlog offset, write set replication checkpoint in system rollback segment page trx_rseg_update_binlog_offset(): Added 2 new parameters to pass binlog file name and binlog offset trx_rseg_array_init(): Return error if the rollback segment slot points to non-existent tablespace srv_undo_tablespaces_init(): Added new parameter mtr to initialize all undo tablespaces trx_assign_rseg_low(): Allow the transaction to use the rollback segment slots(1..127) even if InnoDB failed to change to the requested innodb_undo_tablespaces=0 srv_start(): Override the user specified value of innodb_undo_tablespaces variable with already existing actual undo tablespaces wf_incremental_process(): Detects whether TRX_SYS page has been modified since last backup. If it is then incremental backup fails and throws the information about taking full backup again xb_assign_undo_space_start(): Removed the function. Because undo001 has first undo space id value in page0 Added test case to test the scenario during startup and mariabackup incremental process too. Reviewed-by : Marko Mäkelä Tested-by : Matthias Leich
70 lines
2.4 KiB
Text
70 lines
2.4 KiB
Text
--source include/have_innodb.inc
|
|
--source include/innodb_page_size.inc
|
|
--source include/have_debug.inc
|
|
--source include/not_embedded.inc
|
|
|
|
--echo #
|
|
--echo # MDEV-19229 Allow innodb_undo_tablespaces to be changed
|
|
--echo # after database creation
|
|
--echo #
|
|
let $MYSQLD_DATADIR= `select @@datadir`;
|
|
call mtr.add_suppression("InnoDB: Plugin initialization aborted");
|
|
call mtr.add_suppression("Plugin 'InnoDB' init function returned error");
|
|
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
|
|
|
|
set global innodb_fast_shutdown=0;
|
|
|
|
--echo # case 1: Abort after resetting TRX_SYS page rollback segments
|
|
let $restart_parameters=--innodb_undo_tablespaces=4 --debug_dbug="+d,after_rseg_reset_abort";
|
|
|
|
--source include/restart_mysqld.inc
|
|
|
|
let $restart_parameters=--innodb_undo_tablespaces=4;
|
|
--source include/restart_mysqld.inc
|
|
|
|
--echo # Should list 4 undo log tablespaces
|
|
list_files $MYSQLD_DATADIR undo*;
|
|
|
|
--echo # case 2: Abort after deleting the old undo tablespaces
|
|
let $restart_parameters=--innodb_undo_tablespaces=2 --debug_dbug="+d,after_deleting_old_undo_abort";
|
|
|
|
--source include/restart_mysqld.inc
|
|
|
|
let $restart_parameters=--innodb_undo_tablespaces=2;
|
|
--source include/restart_mysqld.inc
|
|
|
|
--echo # Should list 2 undo log tablespaces
|
|
list_files $MYSQLD_DATADIR undo*;
|
|
|
|
--echo # case 3: Abort after successfully deleting the old undo tablespace
|
|
let $restart_parameters=--innodb_undo_tablespaces=3 --debug_dbug="+d,after_deleting_old_undo_success";
|
|
|
|
--source include/restart_mysqld.inc
|
|
|
|
let $restart_parameters=--innodb_undo_tablespaces=3;
|
|
--source include/restart_mysqld.inc
|
|
|
|
--echo # Should list 3 undo log tablespaces
|
|
list_files $MYSQLD_DATADIR undo*;
|
|
|
|
--echo # case 4: Abort after re-creating new undo tablespaces
|
|
let $restart_parameters=--innodb_undo_tablespaces=4 --debug_dbug="+d,after_reinit_undo_abort";
|
|
|
|
--source include/restart_mysqld.inc
|
|
|
|
let $restart_parameters=--innodb_undo_tablespaces=4;
|
|
--source include/restart_mysqld.inc
|
|
|
|
--echo # Should list 4 undo log tablespaces
|
|
list_files $MYSQLD_DATADIR undo*;
|
|
|
|
--echo # case 5: Abort after re-creating new undo tablespaces successfully
|
|
let $restart_parameters=--innodb_undo_tablespaces=2 --debug_dbug="+d,after_reinit_undo_success";
|
|
|
|
--source include/restart_mysqld.inc
|
|
|
|
let $restart_parameters=--innodb_undo_tablespaces=2;
|
|
--source include/restart_mysqld.inc
|
|
|
|
--echo # Should list 2 undo log tablespaces
|
|
list_files $MYSQLD_DATADIR undo*;
|