-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
MDEV-36301 SET GLOBAL innodb_log_file_disabled, innodb_log_group_home_dir #4014
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # restart: --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log --innodb-undo-tablespaces=0 --innodb-log-file-disabled | ||
| SELECT * FROM INFORMATION_SCHEMA.ENGINES | ||
| WHERE engine = 'innodb' | ||
| AND support IN ('YES', 'DEFAULT', 'ENABLED'); | ||
| ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS | ||
| InnoDB YES Supports transactions, row-level locking, foreign keys and encryption for tables YES YES YES | ||
| # restart: --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log --innodb-undo-tablespaces=0 | ||
| SET GLOBAL innodb_log_file_disabled=ON; | ||
| SET STATEMENT max_statement_time=1e-6 FOR | ||
| SET GLOBAL innodb_log_file_disabled=OFF; | ||
| SET GLOBAL innodb_log_file_disabled=OFF; | ||
| CREATE TABLE t(a SERIAL, b CHAR(255) NOT NULL DEFAULT '') ENGINE=InnoDB; | ||
| SET GLOBAL innodb_log_file_disabled=ON; | ||
| ALTER TABLE t ADD c2 CHAR FIRST; | ||
| INSERT INTO t(a) SELECT * from seq_1_to_10000; | ||
| SET STATEMENT max_statement_time=1e-6 FOR | ||
| SET GLOBAL innodb_log_file_disabled=OFF; | ||
| DROP TABLE t; | ||
| SET GLOBAL innodb_log_file_disabled=OFF; | ||
| SET GLOBAL innodb_log_file_disabled=ON, | ||
| innodb_log_file_size=@@innodb_log_file_size + 4096; | ||
| CREATE TABLE t ENGINE=InnoDB SELECT 1; | ||
| SET GLOBAL innodb_log_file_disabled=OFF, | ||
| innodb_log_file_size=@@innodb_log_file_size - 4096; | ||
| # restart: --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log --innodb-undo-tablespaces=0 | ||
| SELECT * FROM t; | ||
| 1 | ||
| 1 | ||
| DROP TABLE t; | ||
| # restart |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,16 +61,38 @@ SELECT COUNT(*),LENGTH(b) FROM t GROUP BY b; | |
| COUNT(*) LENGTH(b) | ||
| 9 0 | ||
| 19991 255 | ||
| SELECT @@innodb_log_group_home_dir; | ||
| @@innodb_log_group_home_dir | ||
| ./ | ||
| ib_logfile0 | ||
| SHOW VARIABLES LIKE 'innodb_log_file_size'; | ||
| Variable_name Value | ||
| innodb_log_file_size 5242880 | ||
| SET GLOBAL innodb_log_file_size=6291456; | ||
| SET GLOBAL innodb_log_file_disabled=ON; | ||
| SET GLOBAL innodb_log_group_home_dir='log'; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding a comment here to capture our discussion. Changing
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is right. I edited the description of MDEV-36301 to try to make this clearer. |
||
| SELECT @@innodb_log_group_home_dir; | ||
| @@innodb_log_group_home_dir | ||
| log | ||
| SET GLOBAL innodb_log_file_size=6291456,innodb_log_file_disabled=OFF, | ||
| innodb_log_group_home_dir='log/'; | ||
| ib_logfile0 | ||
| SHOW VARIABLES LIKE 'innodb_log_file_size'; | ||
| Variable_name Value | ||
| innodb_log_file_size 6291456 | ||
| SET GLOBAL innodb_log_file_size=5242880; | ||
| SELECT @@innodb_log_group_home_dir; | ||
| @@innodb_log_group_home_dir | ||
| log/ | ||
| SET GLOBAL innodb_log_group_home_dir='log'; | ||
| ib_logfile0 | ||
| SELECT @@innodb_log_group_home_dir; | ||
| @@innodb_log_group_home_dir | ||
| log | ||
| SET GLOBAL innodb_log_file_size=5242880,innodb_log_group_home_dir=default; | ||
| SHOW VARIABLES LIKE 'innodb_log_file_size'; | ||
| Variable_name Value | ||
| innodb_log_file_size 5242880 | ||
| FOUND 1 /InnoDB: Resized log to 6\.000MiB/ in mysqld.1.err | ||
| SHOW VARIABLES LIKE 'innodb_group_home_dir'; | ||
| Variable_name Value | ||
| ib_logfile0 | ||
| FOUND 3 /InnoDB: Resized log to 6\.000MiB/ in mysqld.1.err | ||
| DROP TABLE t; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| --skip-innodb-undo-tablespaces | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggest to add a comment on why we need to disable undo tablespaces.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK. The reason is that this test is bootstrapping a new InnoDB data directory, and it assumes that we have |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| --source include/have_innodb.inc | ||
| --source include/have_sequence.inc | ||
|
|
||
| let $bugdir= $MYSQLTEST_VARDIR/tmp/log; | ||
| --mkdir $bugdir | ||
| let $check_no_innodb=SELECT * FROM INFORMATION_SCHEMA.ENGINES | ||
| WHERE engine = 'innodb' | ||
| AND support IN ('YES', 'DEFAULT', 'ENABLED'); | ||
|
|
||
| --let $ibp=--innodb-log-group-home-dir=$bugdir --innodb-data-home-dir=$bugdir | ||
| --let $ibp=$ibp --innodb-undo-tablespaces=0 | ||
|
|
||
| --let $restart_parameters= $ibp --innodb-log-file-disabled | ||
| --source include/restart_mysqld.inc | ||
| eval $check_no_innodb; | ||
| --rmdir $bugdir | ||
| --mkdir $bugdir | ||
| --let $restart_parameters= $ibp | ||
| --source include/restart_mysqld.inc | ||
| SET GLOBAL innodb_log_file_disabled=ON; | ||
| SET STATEMENT max_statement_time=1e-6 FOR | ||
| SET GLOBAL innodb_log_file_disabled=OFF; | ||
| SET GLOBAL innodb_log_file_disabled=OFF; | ||
| CREATE TABLE t(a SERIAL, b CHAR(255) NOT NULL DEFAULT '') ENGINE=InnoDB; | ||
| SET GLOBAL innodb_log_file_disabled=ON; | ||
| ALTER TABLE t ADD c2 CHAR FIRST; | ||
| INSERT INTO t(a) SELECT * from seq_1_to_10000; | ||
| SET STATEMENT max_statement_time=1e-6 FOR | ||
| SET GLOBAL innodb_log_file_disabled=OFF; | ||
| DROP TABLE t; | ||
|
Comment on lines
+25
to
+30
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
What we could add is a check that a startup with |
||
| SET GLOBAL innodb_log_file_disabled=OFF; | ||
|
|
||
| #--error ER_WRONG_VALUE_FOR_VAR | ||
| #SET GLOBAL innodb_log_file_disabled=ON,innodb_log_file_size=10485761; | ||
| SET GLOBAL innodb_log_file_disabled=ON, | ||
| innodb_log_file_size=@@innodb_log_file_size + 4096; | ||
| CREATE TABLE t ENGINE=InnoDB SELECT 1; | ||
| SET GLOBAL innodb_log_file_disabled=OFF, | ||
| innodb_log_file_size=@@innodb_log_file_size - 4096; | ||
| --source include/restart_mysqld.inc | ||
| SELECT * FROM t; | ||
| DROP TABLE t; | ||
|
Comment on lines
+40
to
+42
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should also specify and test the scenario of default and slow shutdown (innodb_fast_shutdown=0,1) when innodb_log_file_disabled=ON. Do we expect it to work ? In MySQL it works as all pages are flushed and no redo recovery is involved.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should work, and the test step is worth adding. Due to b07920b, InnoDB would only start up with |
||
| --let $restart_parameters= | ||
| --source include/restart_mysqld.inc | ||
| --rmdir $bugdir | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| --source include/have_innodb.inc | ||
| --source include/have_sequence.inc | ||
| --source include/not_embedded.inc | ||
| --source include/no_valgrind_without_big.inc | ||
|
|
||
| # | ||
|
|
@@ -76,13 +77,34 @@ reap; | |
|
|
||
| SELECT * FROM t WHERE a<10; | ||
| SELECT COUNT(*),LENGTH(b) FROM t GROUP BY b; | ||
|
|
||
| SELECT @@innodb_log_group_home_dir; | ||
| let $datadir=`select @@datadir`; | ||
| --list_files $datadir ib_logfile* | ||
| --mkdir $datadir/log | ||
| SHOW VARIABLES LIKE 'innodb_log_file_size'; | ||
| SET GLOBAL innodb_log_file_size=6291456; | ||
| SET GLOBAL innodb_log_file_disabled=ON; | ||
| --list_files $datadir ib_logfile* | ||
| --list_files $datadir/log ib_logfile* | ||
| SET GLOBAL innodb_log_group_home_dir='log'; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens if a concurrent mariabackup is copying the redo log files ? Are we synchronizing with backup locks. Let's define the behaviour and test. This comment is relevant for both
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When For |
||
| SELECT @@innodb_log_group_home_dir; | ||
| --list_files $datadir/log ib_logfile* | ||
| SET GLOBAL innodb_log_file_size=6291456,innodb_log_file_disabled=OFF, | ||
| innodb_log_group_home_dir='log/'; | ||
| --list_files $datadir/log ib_logfile* | ||
| SHOW VARIABLES LIKE 'innodb_log_file_size'; | ||
| SET GLOBAL innodb_log_file_size=5242880; | ||
| SELECT @@innodb_log_group_home_dir; | ||
| --list_files $datadir ib_logfile* | ||
| SET GLOBAL innodb_log_group_home_dir='log'; | ||
| --list_files $datadir/log ib_logfile* | ||
| SELECT @@innodb_log_group_home_dir; | ||
| --list_files $datadir ib_logfile* | ||
| SET GLOBAL innodb_log_file_size=5242880,innodb_log_group_home_dir=default; | ||
| SHOW VARIABLES LIKE 'innodb_log_file_size'; | ||
| --list_files $datadir/log ib_logfile* | ||
| SHOW VARIABLES LIKE 'innodb_group_home_dir'; | ||
| --list_files $datadir ib_logfile* | ||
| let SEARCH_PATTERN = InnoDB: Resized log to 6\\.000MiB; | ||
| --source include/search_pattern_in_file.inc | ||
| --rmdir $datadir/log | ||
|
|
||
| DROP TABLE t; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The warnings seem useful. Should we remove them ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The warnings are not being localized via
errmsg-utf8.txt; they are always in English. I wanted to makeinnodb_log_checkpoint_nowto be able to use the same interface once MDEV-36828 has been fixed. The changes related toinnodb_log_checkpoint_nowcan surely be reverted.