-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
MDEV-38936 Proactive handling of InnoDB tablespace full condition #4721
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
Open
FarihaIS
wants to merge
1
commit into
MariaDB:main
Choose a base branch
from
FarihaIS:mdev-38936
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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
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,74 @@ | ||
| # | ||
| # MDEV-38936: Proactive handling of InnoDB tablespace full condition | ||
| # | ||
| # Test basic warning emission | ||
| SET GLOBAL innodb_tablespace_size_warning_threshold = 10485760; | ||
| SET GLOBAL innodb_tablespace_size_warning_pct = 70; | ||
| CREATE TABLE t1 ( | ||
| id INT AUTO_INCREMENT PRIMARY KEY, | ||
| data LONGBLOB | ||
| ) ENGINE=InnoDB; | ||
| INSERT INTO t1 (data) SELECT REPEAT('a', 1024*1024) FROM seq_1_to_10; | ||
| FOUND 1 /Tablespace 'test/t1' size 7340032 bytes reached 70% of configured threshold of 10485760 bytes/ in mysqld.1.err | ||
| FOUND 1 /Tablespace 'test/t1' size 8388608 bytes reached 80% of configured threshold of 10485760 bytes/ in mysqld.1.err | ||
| FOUND 1 /Tablespace 'test/t1' size 9437184 bytes reached 90% of configured threshold of 10485760 bytes/ in mysqld.1.err | ||
| FOUND 1 /Tablespace 'test/t1' size 10485760 bytes reached 100% of configured threshold of 10485760 bytes/ in mysqld.1.err | ||
| DROP TABLE t1; | ||
| # Test configurable warning percentage | ||
| SET GLOBAL innodb_tablespace_size_warning_threshold = 10485760; | ||
| SET GLOBAL innodb_tablespace_size_warning_pct = 80; | ||
| CREATE TABLE t1b ( | ||
| id INT AUTO_INCREMENT PRIMARY KEY, | ||
| data LONGBLOB | ||
| ) ENGINE=InnoDB; | ||
| INSERT INTO t1b (data) SELECT REPEAT('x', 1024*1024) FROM seq_1_to_8; | ||
| FOUND 1 /Tablespace 'test/t1b' size 8388608 bytes reached 80% of configured threshold of 10485760 bytes/ in mysqld.1.err | ||
| FOUND 1 /Tablespace 'test/t1b' size 9437184 bytes reached 90% of configured threshold of 10485760 bytes/ in mysqld.1.err | ||
| DROP TABLE t1b; | ||
| # Test threshold set to zero disables warnings | ||
| SET GLOBAL innodb_tablespace_size_warning_threshold = 0; | ||
| CREATE TABLE t2 ( | ||
| id INT AUTO_INCREMENT PRIMARY KEY, | ||
| data LONGBLOB | ||
| ) ENGINE=InnoDB; | ||
| INSERT INTO t2 (data) SELECT REPEAT('b', 1024*1024) FROM seq_1_to_5; | ||
| NOT FOUND /Tablespace 'test/t2' size \d+ bytes reached \d+% of configured threshold/ in mysqld.1.err | ||
| DROP TABLE t2; | ||
| # Test disable via threshold=0 then re-enable | ||
| SET GLOBAL innodb_tablespace_size_warning_threshold = 0; | ||
| SET GLOBAL innodb_tablespace_size_warning_pct = 70; | ||
| CREATE TABLE t3 ( | ||
| id INT AUTO_INCREMENT PRIMARY KEY, | ||
| data LONGBLOB | ||
| ) ENGINE=InnoDB; | ||
| INSERT INTO t3 (data) SELECT REPEAT('c', 1024*1024) FROM seq_1_to_10; | ||
| SET GLOBAL innodb_tablespace_size_warning_threshold = 10485760; | ||
| INSERT INTO t3 (data) VALUES (REPEAT('d', 1024*1024)); | ||
| FOUND 1 /Tablespace 'test/t3' size 12582912 bytes reached 100% of configured threshold of 10485760 bytes/ in mysqld.1.err | ||
| DROP TABLE t3; | ||
| # Test TRUNCATE TABLE resets warning state | ||
| CREATE TABLE t4 ( | ||
| id INT AUTO_INCREMENT PRIMARY KEY, | ||
| data LONGBLOB | ||
| ) ENGINE=InnoDB; | ||
| INSERT INTO t4 (data) SELECT REPEAT('e', 1024*1024) FROM seq_1_to_10; | ||
| FOUND 1 /Tablespace 'test/t4' size 7340032 bytes reached 70% of configured threshold of 10485760 bytes/ in mysqld.1.err | ||
| FOUND 1 /Tablespace 'test/t4' size 10485760 bytes reached 100% of configured threshold of 10485760 bytes/ in mysqld.1.err | ||
| TRUNCATE TABLE t4; | ||
| INSERT INTO t4 (data) SELECT REPEAT('f', 1024*1024) FROM seq_1_to_10; | ||
| FOUND 2 /Tablespace 'test/t4' size 7340032 bytes reached 70% of configured threshold of 10485760 bytes/ in mysqld.1.err | ||
| FOUND 2 /Tablespace 'test/t4' size 10485760 bytes reached 100% of configured threshold of 10485760 bytes/ in mysqld.1.err | ||
| DROP TABLE t4; | ||
| # Test behavior when tablespace exceeds 100% of threshold | ||
| SET GLOBAL innodb_tablespace_size_warning_threshold = 5242880; | ||
| SET GLOBAL innodb_tablespace_size_warning_pct = 70; | ||
| CREATE TABLE t5 ( | ||
| id INT AUTO_INCREMENT PRIMARY KEY, | ||
| data LONGBLOB | ||
| ) ENGINE=InnoDB; | ||
| INSERT INTO t5 (data) SELECT REPEAT('g', 1024*1024) FROM seq_1_to_10; | ||
| FOUND 1 /Tablespace 'test/t5' size 4194304 bytes reached 80% of configured threshold of 5242880 bytes/ in mysqld.1.err | ||
| FOUND 1 /Tablespace 'test/t5' size 5242880 bytes reached 100% of configured threshold of 5242880 bytes/ in mysqld.1.err | ||
| DROP TABLE t5; | ||
| SET GLOBAL innodb_tablespace_size_warning_threshold = 0; | ||
| SET GLOBAL innodb_tablespace_size_warning_pct = 85; |
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,134 @@ | ||
| --source include/have_innodb.inc | ||
| --source include/have_innodb_16k.inc | ||
| --source include/have_sequence.inc | ||
| --source include/not_embedded.inc | ||
|
|
||
| --disable_query_log | ||
| call mtr.add_suppression("InnoDB: Tablespace .* size .* bytes reached .* of configured threshold"); | ||
| --enable_query_log | ||
|
|
||
| --echo # | ||
| --echo # MDEV-38936: Proactive handling of InnoDB tablespace full condition | ||
| --echo # | ||
|
|
||
| --echo # Test basic warning emission | ||
| SET GLOBAL innodb_tablespace_size_warning_threshold = 10485760; | ||
| SET GLOBAL innodb_tablespace_size_warning_pct = 70; | ||
|
|
||
| CREATE TABLE t1 ( | ||
| id INT AUTO_INCREMENT PRIMARY KEY, | ||
| data LONGBLOB | ||
| ) ENGINE=InnoDB; | ||
|
|
||
| INSERT INTO t1 (data) SELECT REPEAT('a', 1024*1024) FROM seq_1_to_10; | ||
|
|
||
| let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err; | ||
| let SEARCH_PATTERN=Tablespace 'test/t1' size 7340032 bytes reached 70% of configured threshold of 10485760 bytes; | ||
| --source include/search_pattern_in_file.inc | ||
| let SEARCH_PATTERN=Tablespace 'test/t1' size 8388608 bytes reached 80% of configured threshold of 10485760 bytes; | ||
| --source include/search_pattern_in_file.inc | ||
| let SEARCH_PATTERN=Tablespace 'test/t1' size 9437184 bytes reached 90% of configured threshold of 10485760 bytes; | ||
| --source include/search_pattern_in_file.inc | ||
| let SEARCH_PATTERN=Tablespace 'test/t1' size 10485760 bytes reached 100% of configured threshold of 10485760 bytes; | ||
| --source include/search_pattern_in_file.inc | ||
|
|
||
| DROP TABLE t1; | ||
|
|
||
| --echo # Test configurable warning percentage | ||
| SET GLOBAL innodb_tablespace_size_warning_threshold = 10485760; | ||
| SET GLOBAL innodb_tablespace_size_warning_pct = 80; | ||
|
|
||
| CREATE TABLE t1b ( | ||
| id INT AUTO_INCREMENT PRIMARY KEY, | ||
| data LONGBLOB | ||
| ) ENGINE=InnoDB; | ||
|
|
||
| INSERT INTO t1b (data) SELECT REPEAT('x', 1024*1024) FROM seq_1_to_8; | ||
|
|
||
| let SEARCH_PATTERN=Tablespace 'test/t1b' size 8388608 bytes reached 80% of configured threshold of 10485760 bytes; | ||
| --source include/search_pattern_in_file.inc | ||
| let SEARCH_PATTERN=Tablespace 'test/t1b' size 9437184 bytes reached 90% of configured threshold of 10485760 bytes; | ||
| --source include/search_pattern_in_file.inc | ||
|
|
||
| DROP TABLE t1b; | ||
|
|
||
| --echo # Test threshold set to zero disables warnings | ||
| SET GLOBAL innodb_tablespace_size_warning_threshold = 0; | ||
|
FarihaIS marked this conversation as resolved.
|
||
|
|
||
| CREATE TABLE t2 ( | ||
| id INT AUTO_INCREMENT PRIMARY KEY, | ||
| data LONGBLOB | ||
| ) ENGINE=InnoDB; | ||
|
|
||
| INSERT INTO t2 (data) SELECT REPEAT('b', 1024*1024) FROM seq_1_to_5; | ||
|
|
||
| let SEARCH_PATTERN=Tablespace 'test/t2' size \d+ bytes reached \d+% of configured threshold; | ||
| --source include/search_pattern_in_file.inc | ||
|
|
||
| DROP TABLE t2; | ||
|
|
||
| --echo # Test disable via threshold=0 then re-enable | ||
| SET GLOBAL innodb_tablespace_size_warning_threshold = 0; | ||
| SET GLOBAL innodb_tablespace_size_warning_pct = 70; | ||
|
|
||
| CREATE TABLE t3 ( | ||
| id INT AUTO_INCREMENT PRIMARY KEY, | ||
| data LONGBLOB | ||
| ) ENGINE=InnoDB; | ||
|
|
||
| INSERT INTO t3 (data) SELECT REPEAT('c', 1024*1024) FROM seq_1_to_10; | ||
|
|
||
| SET GLOBAL innodb_tablespace_size_warning_threshold = 10485760; | ||
|
|
||
| INSERT INTO t3 (data) VALUES (REPEAT('d', 1024*1024)); | ||
|
|
||
| let SEARCH_PATTERN=Tablespace 'test/t3' size 12582912 bytes reached 100% of configured threshold of 10485760 bytes; | ||
| --source include/search_pattern_in_file.inc | ||
|
|
||
| DROP TABLE t3; | ||
|
|
||
| --echo # Test TRUNCATE TABLE resets warning state | ||
| CREATE TABLE t4 ( | ||
| id INT AUTO_INCREMENT PRIMARY KEY, | ||
| data LONGBLOB | ||
| ) ENGINE=InnoDB; | ||
|
|
||
| INSERT INTO t4 (data) SELECT REPEAT('e', 1024*1024) FROM seq_1_to_10; | ||
|
|
||
| let SEARCH_PATTERN=Tablespace 'test/t4' size 7340032 bytes reached 70% of configured threshold of 10485760 bytes; | ||
| --source include/search_pattern_in_file.inc | ||
| let SEARCH_PATTERN=Tablespace 'test/t4' size 10485760 bytes reached 100% of configured threshold of 10485760 bytes; | ||
| --source include/search_pattern_in_file.inc | ||
|
|
||
| TRUNCATE TABLE t4; | ||
|
|
||
| INSERT INTO t4 (data) SELECT REPEAT('f', 1024*1024) FROM seq_1_to_10; | ||
|
|
||
| let SEARCH_PATTERN=Tablespace 'test/t4' size 7340032 bytes reached 70% of configured threshold of 10485760 bytes; | ||
| --source include/search_pattern_in_file.inc | ||
| let SEARCH_PATTERN=Tablespace 'test/t4' size 10485760 bytes reached 100% of configured threshold of 10485760 bytes; | ||
| --source include/search_pattern_in_file.inc | ||
|
|
||
| DROP TABLE t4; | ||
|
|
||
| --echo # Test behavior when tablespace exceeds 100% of threshold | ||
| SET GLOBAL innodb_tablespace_size_warning_threshold = 5242880; | ||
| SET GLOBAL innodb_tablespace_size_warning_pct = 70; | ||
|
|
||
| CREATE TABLE t5 ( | ||
| id INT AUTO_INCREMENT PRIMARY KEY, | ||
| data LONGBLOB | ||
| ) ENGINE=InnoDB; | ||
|
|
||
| INSERT INTO t5 (data) SELECT REPEAT('g', 1024*1024) FROM seq_1_to_10; | ||
|
|
||
| let SEARCH_PATTERN=Tablespace 'test/t5' size 4194304 bytes reached 80% of configured threshold of 5242880 bytes; | ||
| --source include/search_pattern_in_file.inc | ||
| let SEARCH_PATTERN=Tablespace 'test/t5' size 5242880 bytes reached 100% of configured threshold of 5242880 bytes; | ||
| --source include/search_pattern_in_file.inc | ||
|
|
||
| DROP TABLE t5; | ||
|
|
||
| # Restore default values | ||
| SET GLOBAL innodb_tablespace_size_warning_threshold = 0; | ||
| SET GLOBAL innodb_tablespace_size_warning_pct = 85; | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.