Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug#30088404 : CONCURRENT LOG BUFFER OF 8.0 CAUSES REGRESSION OF CPU …
…BOUND PERFORMANCE ON LOW-END ARCHITECTURE - improved ut0link_buf.h and log_closer_thread was removed because not needed - add variable to choose former style log_write_up_to for low-end servers cpu% bound innodb_log_writer_threads=[ON|OFF] - optimized checkpoint and sync_flush behavior RB: 23457 Reviewed-by: Pawel Olchawa <pawel.olchawa@oracle.com>
- Loading branch information
Yasufumi Kinoshita
committed
Apr 6, 2020
1 parent
1cf7773
commit 9bfe602
Showing
24 changed files
with
881 additions
and
617 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
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,16 @@ | ||
SET GLOBAL innodb_flush_log_at_trx_commit = 1; | ||
CREATE TABLE t1 (a CHAR(8)); | ||
SET GLOBAL innodb_log_writer_threads = ON; | ||
SET DEBUG_SYNC = 'RESET'; | ||
SET DEBUG_SYNC = 'log_flushed_by_writer SIGNAL log_flushed'; | ||
SET AUTOCOMMIT = 1; | ||
INSERT INTO t1 (a) VALUES ('a'); | ||
SET DEBUG_SYNC = 'now WAIT_FOR log_flushed'; | ||
SET GLOBAL innodb_log_writer_threads = OFF; | ||
SET DEBUG_SYNC = 'RESET'; | ||
SET DEBUG_SYNC = 'log_flushed_by_self SIGNAL log_flushed'; | ||
SET AUTOCOMMIT = 1; | ||
INSERT INTO t1 (a) VALUES ('a'); | ||
SET DEBUG_SYNC = 'now WAIT_FOR log_flushed'; | ||
SET DEBUG_SYNC = 'RESET'; | ||
DROP TABLE t1; |
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,49 @@ | ||
--source include/have_debug.inc | ||
--source include/have_debug_sync.inc | ||
|
||
--disable_query_log | ||
SET @old_innodb_log_writer_threads = @@innodb_log_writer_threads; | ||
SET @old_innodb_flush_log_at_trx_commit = @@innodb_flush_log_at_trx_commit; | ||
--enable_query_log | ||
|
||
# Save the initial number of concurrent sessions | ||
--source include/count_sessions.inc | ||
|
||
SET GLOBAL innodb_flush_log_at_trx_commit = 1; | ||
|
||
--connect (con1,localhost,root,,) | ||
|
||
CREATE TABLE t1 (a CHAR(8)); | ||
|
||
# log flushed by writer threads | ||
SET GLOBAL innodb_log_writer_threads = ON; | ||
SET DEBUG_SYNC = 'RESET'; | ||
--connection con1 | ||
SET DEBUG_SYNC = 'log_flushed_by_writer SIGNAL log_flushed'; | ||
SET AUTOCOMMIT = 1; | ||
INSERT INTO t1 (a) VALUES ('a'); | ||
--connection default | ||
SET DEBUG_SYNC = 'now WAIT_FOR log_flushed'; | ||
|
||
# log flushed by user thread | ||
SET GLOBAL innodb_log_writer_threads = OFF; | ||
SET DEBUG_SYNC = 'RESET'; | ||
--connection con1 | ||
SET DEBUG_SYNC = 'log_flushed_by_self SIGNAL log_flushed'; | ||
SET AUTOCOMMIT = 1; | ||
INSERT INTO t1 (a) VALUES ('a'); | ||
--connection default | ||
SET DEBUG_SYNC = 'now WAIT_FOR log_flushed'; | ||
|
||
# Cleanup | ||
SET DEBUG_SYNC = 'RESET'; | ||
--disconnect con1 | ||
DROP TABLE t1; | ||
|
||
--disable_query_log | ||
SET GLOBAL innodb_log_writer_threads = @old_innodb_log_writer_threads; | ||
SET GLOBAL innodb_flush_log_at_trx_commit = @old_innodb_flush_log_at_trx_commit; | ||
--enable_query_log | ||
|
||
# Wait till all disconnects are completed. | ||
--source include/wait_until_count_sessions.inc |
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
34 changes: 34 additions & 0 deletions
34
mysql-test/suite/sys_vars/r/innodb_log_writer_threads_basic.result
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,34 @@ | ||
SET @orig = @@global.innodb_log_writer_threads; | ||
SET GLOBAL innodb_log_writer_threads = OFF; | ||
SELECT @@global.innodb_log_writer_threads; | ||
@@global.innodb_log_writer_threads | ||
0 | ||
SET GLOBAL innodb_log_writer_threads = default; | ||
SELECT @@global.innodb_log_writer_threads; | ||
@@global.innodb_log_writer_threads | ||
1 | ||
SET GLOBAL innodb_log_writer_threads = ON; | ||
SELECT @@global.innodb_log_writer_threads; | ||
@@global.innodb_log_writer_threads | ||
1 | ||
SET GLOBAL innodb_log_writer_threads = 2; | ||
ERROR 42000: Variable 'innodb_log_writer_threads' can't be set to the value of '2' | ||
SELECT @@global.innodb_log_writer_threads; | ||
@@global.innodb_log_writer_threads | ||
1 | ||
SET GLOBAL innodb_log_writer_threads = 1e2; | ||
ERROR 42000: Incorrect argument type to variable 'innodb_log_writer_threads' | ||
SELECT @@global.innodb_log_writer_threads; | ||
@@global.innodb_log_writer_threads | ||
1 | ||
SET GLOBAL innodb_log_writer_threads = 1.0; | ||
ERROR 42000: Incorrect argument type to variable 'innodb_log_writer_threads' | ||
SELECT @@global.innodb_log_writer_threads; | ||
@@global.innodb_log_writer_threads | ||
1 | ||
SET innodb_log_writer_threads = OFF; | ||
ERROR HY000: Variable 'innodb_log_writer_threads' is a GLOBAL variable and should be set with SET GLOBAL | ||
SELECT @@global.innodb_log_writer_threads; | ||
@@global.innodb_log_writer_threads | ||
1 | ||
SET GLOBAL innodb_log_writer_threads = @orig; |
29 changes: 29 additions & 0 deletions
29
mysql-test/suite/sys_vars/t/innodb_log_writer_threads_basic.test
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,29 @@ | ||
# Check the default value | ||
SET @orig = @@global.innodb_log_writer_threads; | ||
|
||
SET GLOBAL innodb_log_writer_threads = OFF; | ||
SELECT @@global.innodb_log_writer_threads; | ||
|
||
SET GLOBAL innodb_log_writer_threads = default; | ||
SELECT @@global.innodb_log_writer_threads; | ||
|
||
SET GLOBAL innodb_log_writer_threads = ON; | ||
SELECT @@global.innodb_log_writer_threads; | ||
|
||
-- error ER_WRONG_VALUE_FOR_VAR | ||
SET GLOBAL innodb_log_writer_threads = 2; | ||
SELECT @@global.innodb_log_writer_threads; | ||
|
||
-- error ER_WRONG_TYPE_FOR_VAR | ||
SET GLOBAL innodb_log_writer_threads = 1e2; | ||
SELECT @@global.innodb_log_writer_threads; | ||
|
||
-- error ER_WRONG_TYPE_FOR_VAR | ||
SET GLOBAL innodb_log_writer_threads = 1.0; | ||
SELECT @@global.innodb_log_writer_threads; | ||
|
||
-- error ER_GLOBAL_VARIABLE | ||
SET innodb_log_writer_threads = OFF; | ||
SELECT @@global.innodb_log_writer_threads; | ||
|
||
SET GLOBAL innodb_log_writer_threads = @orig; |
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
Oops, something went wrong.