summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
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);
}