summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2022-11-29 16:23:46 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2022-11-29 16:28:40 +0530
commitb18241e059c17d4ad533dac3729302aa0ef60345 (patch)
tree8f713e83ff8e2df9fdaa0cadd1ec12c2b59d2938
parent936436ef437c73911c18854a8ce8dad1216331b8 (diff)
downloadmariadb-git-b18241e059c17d4ad533dac3729302aa0ef60345.tar.gz
MDEV-30122 mariabackup.skip_innodb crashes when innodb_undo_tablespaces > 0
- Assign srv_undo_space_id_start when InnoDB opens extra unused InnoDB undo tablespaces in srv_all_undo_tablespaces_open(). Mariabackup can detect the undo tablespaces using srv_undo_space_id_start variable
-rw-r--r--mysql-test/suite/mariabackup/skip_innodb.test3
-rw-r--r--storage/innobase/srv/srv0start.cc6
2 files changed, 6 insertions, 3 deletions
diff --git a/mysql-test/suite/mariabackup/skip_innodb.test b/mysql-test/suite/mariabackup/skip_innodb.test
index 14e4bc007f6..25495b308b0 100644
--- a/mysql-test/suite/mariabackup/skip_innodb.test
+++ b/mysql-test/suite/mariabackup/skip_innodb.test
@@ -1,3 +1,4 @@
+--source include/innodb_undo_tablespaces.inc
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
CREATE TABLE t(i int);
INSERT INTO t VALUES(1);
@@ -9,4 +10,4 @@ exec $XTRABACKUP --prepare --target-dir=$targetdir;
SELECT * from t;
DROP TABLE t;
-rmdir $targetdir; \ No newline at end of file
+rmdir $targetdir;
diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc
index 364775207e0..60b1a06e9ca 100644
--- a/storage/innobase/srv/srv0start.cc
+++ b/storage/innobase/srv/srv0start.cc
@@ -817,9 +817,11 @@ static dberr_t srv_all_undo_tablespaces_open(bool create_new_undo,
{
char name[OS_FILE_MAX_PATH];
snprintf(name, sizeof name, "%s/undo%03u", srv_undo_dir, i);
- if (!srv_undo_tablespace_open(create_new_undo, name, i))
+ uint32_t space_id= srv_undo_tablespace_open(create_new_undo, name, i);
+ if (!space_id)
break;
- ++srv_undo_tablespaces_open;
+ if (0 == srv_undo_tablespaces_open++)
+ srv_undo_space_id_start= space_id;
}
return DB_SUCCESS;