summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2022-12-02 11:54:35 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2022-12-02 15:48:37 +0530
commitdd20a43c6cb59a2ba69124cf51e22e08ca16f858 (patch)
treee3e43f6707a53666cf19078b5d9e92b58efae00e /extra
parent7487c313bc1d6ce1a525002745105bd076f4fcba (diff)
downloadmariadb-git-dd20a43c6cb59a2ba69124cf51e22e08ca16f858.tar.gz
MDEV-30114 Incremental prepare fails when innodb_undo_tablespaces > 0
- Mariabackup fails to open the undo tablespaces while applying delta files to the corresponding data file. Mariabackup opens the undo tablespaces first time in srv_undo_tablespaces_init() and does tries to open the undo tablespaces in xtrabackup_apply_deltas() with conflicting mode and leads to the failure. - Mariabackup should close the undo tablespaces before applying the incremental delta files.
Diffstat (limited to 'extra')
-rw-r--r--extra/mariabackup/xtrabackup.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index 3f7dec5ceda..d41321e9bb9 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -3799,6 +3799,21 @@ func_exit:
return error;
}
+/** Close all undo tablespaces while applying incremental delta */
+static void xb_close_undo_tablespaces()
+{
+ if (srv_undo_space_id_start == 0)
+ return;
+ for (ulint space_id= srv_undo_space_id_start;
+ space_id < srv_undo_space_id_start + srv_undo_tablespaces_open;
+ space_id++)
+ {
+ fil_space_t *space= fil_space_get(space_id);
+ ut_ad(space);
+ space->close();
+ }
+}
+
/****************************************************************************
Populates the tablespace memory cache by scanning for and opening data files.
@returns DB_SUCCESS or error code.*/
@@ -3861,6 +3876,11 @@ xb_load_tablespaces()
if (err != DB_SUCCESS) {
return(err);
}
+
+ if (srv_operation == SRV_OPERATION_RESTORE_DELTA) {
+ xb_close_undo_tablespaces();
+ }
+
DBUG_MARIABACKUP_EVENT("after_load_tablespaces", 0);
return(DB_SUCCESS);
}