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-23711 make mariabackup innodb redo log read error message more c…
…lear log_group_read_log_seg() returns error when: 1) Calculated log block number does not correspond to read log block number. This can be caused by: a) Garbage or an incompletely written log block. We can exclude this case by checking log block checksum if it's enabled(see innodb-log-checksums, encrypted log block contains checksum always). b) The log block is overwritten. In this case checksum will be correct and read log block number will be greater then requested one. 2) When log block length is wrong. In this case recv_sys->found_corrupt_log is set. 3) When redo log block checksum is wrong. In this case innodb code writes messages to error log with the following prefix: "Invalid log block checksum." The fix processes all the cases above.
- Loading branch information
1 parent
69d536a
commit 0a224ed
Showing
5 changed files
with
117 additions
and
3 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
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 @@ | ||
| --loose-innodb-log-file-size=1048576 --loose-innodb-log-files-in-group=2 |
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,28 @@ | ||
| CREATE TABLE t(i INT) ENGINE=INNODB; | ||
| INSERT INTO t VALUES | ||
| (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), | ||
| (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), | ||
| (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), | ||
| (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), | ||
| (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), | ||
| (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), | ||
| (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), | ||
| (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), | ||
| (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), | ||
| (0), (1), (2), (3), (4), (5), (6), (7), (8), (9); | ||
| # Generate enough data to overwrite innodb redo log | ||
| # on the next "INSERT INTO t SELECT * FROM t" execution. | ||
| INSERT INTO t SELECT * FROM t; | ||
| INSERT INTO t SELECT * FROM t; | ||
| INSERT INTO t SELECT * FROM t; | ||
| INSERT INTO t SELECT * FROM t; | ||
| INSERT INTO t SELECT * FROM t; | ||
| INSERT INTO t SELECT * FROM t; | ||
| INSERT INTO t SELECT * FROM t; | ||
| INSERT INTO t SELECT * FROM t; | ||
| INSERT INTO t SELECT * FROM t; | ||
| # xtrabackup backup | ||
| FOUND 1 /failed: redo log block is overwritten/ in backup.log | ||
| FOUND 1 /failed: redo log block checksum does not match/ in backup.log | ||
| FOUND 1 /failed: unknown reason/ in backup.log | ||
| DROP TABLE t; |
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,70 @@ | ||
| --source include/have_innodb.inc | ||
| --source include/have_debug_sync.inc | ||
|
|
||
| CREATE TABLE t(i INT) ENGINE=INNODB; | ||
|
|
||
| INSERT INTO t VALUES | ||
| (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), | ||
| (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), | ||
| (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), | ||
| (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), | ||
| (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), | ||
| (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), | ||
| (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), | ||
| (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), | ||
| (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), | ||
| (0), (1), (2), (3), (4), (5), (6), (7), (8), (9); | ||
| --echo # Generate enough data to overwrite innodb redo log | ||
| --echo # on the next "INSERT INTO t SELECT * FROM t" execution. | ||
| --let $i = 0 | ||
| while ($i < 9) { | ||
| INSERT INTO t SELECT * FROM t; | ||
| --inc $i | ||
| } | ||
|
|
||
| --echo # xtrabackup backup | ||
| --let $targetdir=$MYSQLTEST_VARDIR/tmp/backup | ||
| --let $backuplog=$MYSQLTEST_VARDIR/tmp/backup.log | ||
|
|
||
| --let before_innodb_log_copy_thread_started=INSERT INTO test.t SELECT * FROM test.t | ||
|
|
||
| --disable_result_log | ||
| --error 1 | ||
| --exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --dbug=+d,mariabackup_events > $backuplog | ||
| --enable_result_log | ||
|
|
||
| --let SEARCH_PATTERN=failed: redo log block is overwritten | ||
| --let SEARCH_FILE=$backuplog | ||
| --source include/search_pattern_in_file.inc | ||
| --remove_file $backuplog | ||
| --rmdir $targetdir | ||
|
|
||
| --let before_innodb_log_copy_thread_started=INSERT INTO test.t VALUES (0), (1), (2), (3), (4), (5), (6), (7), (8), (9) | ||
|
|
||
| --disable_result_log | ||
| --error 1 | ||
| --exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --dbug=+d,mariabackup_events,log_checksum_mismatch > $backuplog | ||
| --enable_result_log | ||
|
|
||
| --let SEARCH_PATTERN=failed: redo log block checksum does not match | ||
| --let SEARCH_FILE=$backuplog | ||
| --source include/search_pattern_in_file.inc | ||
| --remove_file $backuplog | ||
| --rmdir $targetdir | ||
|
|
||
| --let before_innodb_log_copy_thread_started=INSERT INTO test.t SELECT * FROM test.t LIMIT 50000 | ||
|
|
||
| --disable_result_log | ||
| --error 1 | ||
| --exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --innodb-log-checksums=0 --dbug=+d,mariabackup_events > $backuplog | ||
| --enable_result_log | ||
|
|
||
| --let SEARCH_PATTERN=failed: unknown reason | ||
| --let SEARCH_FILE=$backuplog | ||
| --source include/search_pattern_in_file.inc | ||
| --remove_file $backuplog | ||
| --rmdir $targetdir | ||
|
|
||
| --let before_innodb_log_copy_thread_started= | ||
|
|
||
| DROP TABLE t; |
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