summaryrefslogtreecommitdiff
path: root/storage/innobase/include/srv0start.h
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2022-10-11 15:14:45 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2022-10-17 21:51:01 +0530
commit162cccee73bc04cf089d35cf457eb109596aec4e (patch)
tree329332c03ac909b6c2a3681b7213caab2d88ace7 /storage/innobase/include/srv0start.h
parentdb330c87d6d253a1e2e93a747327040d9205c5fe (diff)
downloadmariadb-git-bb-10.6-MDEV-19229.tar.gz
MDEV-19229 Allow innodb_undo_tablespaces to be changed after database creationbb-10.6-MDEV-19229
trx_sys_t::undo_log_empty: Set to true if there are no undo log to rollback and purge. The algorithm for re-creating the undo tablespace when trx_sys_t::undo_log_empty is enabled: 1) Free the rollback segment header page of system tablespace for the slots 1..127 2) trx_sys_t::reset_page(): Reset the TRX_SYS page and assign all rollback segment slots from 1..127 to FIL_NULL 3) Update the binlog and WSREP information in system tablespace rollback segment header Step (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 above (6), (7) 8) Make checkpoint again, so that server or mariabackup can read the undo log tablespace page0 before applying the redo logs 9) Assign the rollback segment header page for each rollback segment slots 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 that can be used for reinitialization of 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 trx_assign_rseg_low(): Even user mentioned the innodb_undo_tablespace value as 0, allow the transaction to use the other undo tablespace rollback segment slots srv_start(): Override the user specified value of innodb_undo_tablespaces variable with already existing actual undo tablespaces Added test case to test the scenario during startup and mariabackup incremental process too.
Diffstat (limited to 'storage/innobase/include/srv0start.h')
-rw-r--r--storage/innobase/include/srv0start.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/storage/innobase/include/srv0start.h b/storage/innobase/include/srv0start.h
index 44b19aa666b..1372959d184 100644
--- a/storage/innobase/include/srv0start.h
+++ b/storage/innobase/include/srv0start.h
@@ -33,10 +33,11 @@ Created 10/10/1995 Heikki Tuuri
struct dict_table_t;
/** Open the configured number of dedicated undo tablespaces.
-@param[in] create_new_db whether the database is being initialized
+@param[in] create_new_undo whether the undo tablespaces has to be created
+@param[in] mtr mini-transaction in case of reinitialize
+ of undo tablespaces
@return DB_SUCCESS or error code */
-dberr_t
-srv_undo_tablespaces_init(bool create_new_db);
+dberr_t srv_undo_tablespaces_init(bool create_new_undo, mtr_t *mtr= nullptr);
/** Start InnoDB.
@param[in] create_new_db whether to create a new database