Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
MDEV-18194 Incremental prepare tries to access page which is out of t…
…ablespace bounds Problem: ======= Mariabackup incremental prepare creates new tablespace when it encounter new tablespace. It sets the intial size as FIL_IBD_FILE_INITIAL_SIZE (4). But while applying redo log, it tries to access 5th page and then it leads to out of tablespace error. Fix: === While parsing the redo log record, track FSP_SIZE in recv_spaces for the respective space id. Assign the recv_size for the tablespace when it is loaded. Extend the tablespace depends on recv_size while applying the redo log record.
- Loading branch information
1 parent
a2641b2
commit 7c7161a
Showing
4 changed files
with
109 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| call mtr.add_suppression("InnoDB: New log files created"); | ||
| CREATE TABLE t1(i INT) ENGINE INNODB; | ||
| CREATE TABLE t2(i INT PRIMARY KEY) ENGINE INNODB; | ||
| CREATE TABLE t3(i INT) ENGINE INNODB; | ||
| # Create full backup , modify table, then create incremental/differential backup | ||
| create table t4(f1 int not null, f2 int not null)engine=innodb; | ||
| insert into t4 values(1, 2), (2, 2), (3, 3), (5, 5), (6, 6), (4, 4), (9, 9); | ||
| insert into t4 select * from t4; | ||
| insert into t4 select * from t4; | ||
| insert into t4 select * from t4; | ||
| insert into t4 select * from t4; | ||
| insert into t4 select * from t4; | ||
| insert into t4 select * from t4; | ||
| insert into t4 select * from t4; | ||
| insert into t4 select * from t4; | ||
| insert into t4 select * from t4; | ||
| insert into t4 select * from t4; | ||
| rename table t4 to t7; | ||
| select count(*) from t7; | ||
| count(*) | ||
| 7168 | ||
| # XTRABACKUP INCREMENTAL | ||
| # XTRABACKUP PREPARE | ||
| # XTRABACKUP INCREMENTAL PREPARE | ||
| # shutdown server | ||
| # remove datadir | ||
| # xtrabackup move back | ||
| # restart server | ||
| select count(*) from t7; | ||
| count(*) | ||
| 7168 | ||
| drop table t1, t2, t7, t3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| --source include/have_debug.inc | ||
|
|
||
| call mtr.add_suppression("InnoDB: New log files created"); | ||
|
|
||
| let $basedir=$MYSQLTEST_VARDIR/tmp/backup; | ||
| let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1; | ||
|
|
||
| CREATE TABLE t1(i INT) ENGINE INNODB; | ||
| CREATE TABLE t2(i INT PRIMARY KEY) ENGINE INNODB; | ||
| CREATE TABLE t3(i INT) ENGINE INNODB; | ||
|
|
||
| echo # Create full backup , modify table, then create incremental/differential backup; | ||
| --disable_result_log | ||
| exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir; | ||
| --enable_result_log | ||
|
|
||
| create table t4(f1 int not null, f2 int not null)engine=innodb; | ||
| insert into t4 values(1, 2), (2, 2), (3, 3), (5, 5), (6, 6), (4, 4), (9, 9); | ||
| insert into t4 select * from t4; | ||
| insert into t4 select * from t4; | ||
| insert into t4 select * from t4; | ||
| insert into t4 select * from t4; | ||
| insert into t4 select * from t4; | ||
| insert into t4 select * from t4; | ||
| insert into t4 select * from t4; | ||
| insert into t4 select * from t4; | ||
| insert into t4 select * from t4; | ||
| insert into t4 select * from t4; | ||
| rename table t4 to t7; | ||
| select count(*) from t7; | ||
|
|
||
| --echo # XTRABACKUP INCREMENTAL | ||
| exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$incremental_dir --incremental-basedir=$basedir; | ||
|
|
||
| --echo # XTRABACKUP PREPARE | ||
| exec $XTRABACKUP --apply-log-only --prepare --target-dir=$basedir; | ||
|
|
||
| --echo # XTRABACKUP INCREMENTAL PREPARE | ||
| exec $XTRABACKUP --prepare --target-dir=$basedir --incremental-dir=$incremental_dir; | ||
|
|
||
| let $targetdir=$basedir; | ||
| -- source include/restart_and_restore.inc | ||
| --enable_result_log | ||
|
|
||
| select count(*) from t7; | ||
| drop table t1, t2, t7, t3; | ||
|
|
||
| # Cleanup | ||
| rmdir $basedir; | ||
| rmdir $incremental_dir; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters