-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
MDEV-40332 InnoDB: Defragmentation of BASE_IDX in SYS_VIRTUAL failed: Data structure corruption #5385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+169
−6
Merged
MDEV-40332 InnoDB: Defragmentation of BASE_IDX in SYS_VIRTUAL failed: Data structure corruption #5385
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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,44 @@ | ||
| # | ||
| # MDEV-40332 InnoDB: Defragmentation of BASE_IDX in | ||
| # SYS_VIRTUAL failed: Data structure corruption | ||
| # | ||
| # restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/root_datadir --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/root_datadir --innodb_undo_directory=MYSQLTEST_VARDIR/tmp/root_datadir --debug_dbug=+d,defer_sys_virtual | ||
| # SYS_VIRTUAL is absent for now | ||
| SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES | ||
| WHERE SPACE=0 AND NAME='SYS_VIRTUAL'; | ||
| NAME | ||
| SET GLOBAL innodb_file_per_table= 0; | ||
| Warnings: | ||
| Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release | ||
| SET GLOBAL innodb_limit_optimistic_insert_debug= 2; | ||
| CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL, f3 INT NOT NULL, | ||
| INDEX(f1), INDEX(f2), INDEX(f3)) | ||
| STATS_PERSISTENT=0 ENGINE=InnoDB; | ||
| BEGIN; | ||
| INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384; | ||
| INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384; | ||
| COMMIT; | ||
| # Restart without the flag: SYS_VIRTUAL is now created | ||
| # into the grown tablespace, so its BASE_IDX root page | ||
| # lands in a high extent. | ||
| # restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/root_datadir --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/root_datadir --innodb_undo_directory=MYSQLTEST_VARDIR/tmp/root_datadir | ||
| # SYS_VIRTUAL now exists, and its BASE_IDX root landed | ||
| # above the 10M (640-page) shrink floor | ||
| SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES | ||
| WHERE SPACE=0 AND NAME='SYS_VIRTUAL'; | ||
| NAME | ||
| SYS_VIRTUAL | ||
| SELECT PAGE_NO > 640 AS root_above_shrink_floor | ||
| FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES WHERE SPACE=0 AND NAME='BASE_IDX'; | ||
| root_above_shrink_floor | ||
| 1 | ||
| SET GLOBAL innodb_limit_optimistic_insert_debug= 2; | ||
| INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_32; | ||
| DROP TABLE t1; | ||
| InnoDB 0 transactions not purged | ||
| # restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/root_datadir --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/root_datadir --innodb_undo_directory=MYSQLTEST_VARDIR/tmp/root_datadir --innodb_data_file_path=ibdata1:10M:autoextend:autoshrink --innodb_fast_shutdown=0 | ||
| SELECT FILE_SIZE < $fsize AS shrunk | ||
| FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE=0; | ||
| shrunk | ||
| 1 | ||
| # restart |
This file contains hidden or 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,2 @@ | ||
| --innodb_page_size=16k | ||
| --innodb_sys_tablespaces |
This file contains hidden or 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,66 @@ | ||
| --source include/have_innodb.inc | ||
| --source include/have_debug.inc | ||
| --source include/have_sequence.inc | ||
| --source include/not_embedded.inc | ||
| --source include/not_windows.inc | ||
| --source include/not_valgrind.inc | ||
|
|
||
| --echo # | ||
| --echo # MDEV-40332 InnoDB: Defragmentation of BASE_IDX in | ||
| --echo # SYS_VIRTUAL failed: Data structure corruption | ||
| --echo # | ||
|
|
||
| let bugdir= $MYSQLTEST_VARDIR/tmp/root_datadir; | ||
| --mkdir $bugdir | ||
| let $dirs= --innodb-data-home-dir=$bugdir --innodb-log-group-home-dir=$bugdir --innodb_undo_directory=$bugdir; | ||
|
|
||
| let $restart_parameters=$dirs --debug_dbug=+d,defer_sys_virtual; | ||
| --source include/restart_mysqld.inc | ||
|
|
||
| --echo # SYS_VIRTUAL is absent for now | ||
| SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES | ||
| WHERE SPACE=0 AND NAME='SYS_VIRTUAL'; | ||
|
|
||
| SET GLOBAL innodb_file_per_table= 0; | ||
| SET GLOBAL innodb_limit_optimistic_insert_debug= 2; | ||
| CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL, f3 INT NOT NULL, | ||
| INDEX(f1), INDEX(f2), INDEX(f3)) | ||
| STATS_PERSISTENT=0 ENGINE=InnoDB; | ||
| BEGIN; | ||
| INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384; | ||
| INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384; | ||
| COMMIT; | ||
|
|
||
| --echo # Restart without the flag: SYS_VIRTUAL is now created | ||
| --echo # into the grown tablespace, so its BASE_IDX root page | ||
| --echo # lands in a high extent. | ||
| let $restart_parameters=$dirs; | ||
| --source include/restart_mysqld.inc | ||
|
|
||
| --echo # SYS_VIRTUAL now exists, and its BASE_IDX root landed | ||
| --echo # above the 10M (640-page) shrink floor | ||
| SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES | ||
| WHERE SPACE=0 AND NAME='SYS_VIRTUAL'; | ||
|
|
||
| SELECT PAGE_NO > 640 AS root_above_shrink_floor | ||
| FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES WHERE SPACE=0 AND NAME='BASE_IDX'; | ||
|
|
||
| SET GLOBAL innodb_limit_optimistic_insert_debug= 2; | ||
| INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_32; | ||
| DROP TABLE t1; | ||
| --source include/wait_all_purged.inc | ||
|
|
||
| let $fsize=`SELECT FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES | ||
| WHERE SPACE=0`; | ||
|
|
||
| let $restart_parameters=$dirs --innodb_data_file_path=ibdata1:10M:autoextend:autoshrink --innodb_fast_shutdown=0; | ||
| --source include/restart_mysqld.inc | ||
|
|
||
| let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err; | ||
|
|
||
| evalp SELECT FILE_SIZE < $fsize AS shrunk | ||
| FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE=0; | ||
|
|
||
| let $restart_parameters=; | ||
| --source include/restart_mysqld.inc | ||
| --rmdir $bugdir |
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.