mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 02:51:44 +01:00
5eb539555b
The flushing of the InnoDB temporary tablespace is unnecessarily tied to the write-ahead redo logging and redo log checkpoints, which must be tied to the page writes of persistent tablespaces. Let us simply omit any pages of temporary tables from buf_pool.flush_list. In this way, log checkpoints will never incur any 'collateral damage' of writing out unmodified changes for temporary tables. After this change, pages of the temporary tablespace can only be written out by buf_flush_lists(n_pages,0) as part of LRU eviction. Hopefully, most of the time, that code will never be executed, and instead, the temporary pages will be evicted by buf_release_freed_page() without ever being written back to the temporary tablespace file. This should improve the efficiency of the checkpoint flushing and the buf_flush_page_cleaner thread. Reviewed by: Vladislav Vaintroub
93 lines
2.4 KiB
Text
93 lines
2.4 KiB
Text
--source include/have_innodb.inc
|
|
--source include/have_debug.inc
|
|
--source include/not_embedded.inc
|
|
|
|
# Two parallel connection with autoinc column after restart.
|
|
|
|
CREATE TABLE t1 (id INT AUTO_INCREMENT PRIMARY KEY)ENGINE=INNODB;
|
|
|
|
--echo # SETTING auto_increment_increment IN CONNECTION DEFAULT
|
|
SET AUTO_INCREMENT_INCREMENT = 1;
|
|
|
|
--echo # MDEV-24348 InnoDB shutdown hang with innodb_flush_sync=0
|
|
SET GLOBAL innodb_flush_sync=OFF;
|
|
--echo # For the server to hang, we must have pages for temporary tables
|
|
--echo # (and the bug depended on MDEV-12227 not being fixed).
|
|
CREATE TEMPORARY TABLE t (id SERIAL) ENGINE=InnoDB;
|
|
SET debug_dbug= '+d,ib_log_flush_ahead';
|
|
|
|
INSERT INTO t1 VALUES(NULL);
|
|
SELECT * FROM t1;
|
|
SHOW CREATE TABLE t1;
|
|
|
|
--source include/restart_mysqld.inc
|
|
|
|
--echo # SETTING auto_increment_increment IN CONNECTION1
|
|
SET AUTO_INCREMENT_INCREMENT = 2;
|
|
|
|
SET DEBUG_SYNC= 'ib_after_row_insert SIGNAL opened WAIT_FOR flushed1';
|
|
|
|
SEND INSERT INTO t1 VALUES(NULL);
|
|
|
|
connect(con1, localhost, root,,);
|
|
SET AUTO_INCREMENT_INCREMENT = 2;
|
|
SET DEBUG_SYNC= 'now WAIT_FOR opened';
|
|
SET DEBUG_SYNC= 'ib_after_row_insert_step SIGNAL flushed1 WAIT_FOR opened1';
|
|
send insert into t1 values(NULL);
|
|
|
|
connection default;
|
|
reap;
|
|
SELECT * FROM t1;
|
|
SHOW CREATE TABLE t1;
|
|
SET DEBUG_SYNC= 'now SIGNAL opened1';
|
|
|
|
connection con1;
|
|
reap;
|
|
SELECT * FROM t1;
|
|
SHOW CREATE TABLE t1;
|
|
connection default;
|
|
disconnect con1;
|
|
|
|
DROP TABLE t1;
|
|
|
|
# Two parallel connection with autoinc column without restart.
|
|
|
|
CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY)ENGINE=INNODB;
|
|
|
|
--echo # SETTING auto_increment_increment IN CONNECTION DEFAULT
|
|
SET AUTO_INCREMENT_INCREMENT = 1;
|
|
INSERT INTO t1 VALUES(NULL);
|
|
SELECT * FROM t1;
|
|
SHOW CREATE TABLE t1;
|
|
SET DEBUG_SYNC = 'now SIGNAL flushed';
|
|
|
|
connect(con1, localhost, root,,);
|
|
|
|
--echo # SETTING auto_increment_increment in connection1
|
|
SET AUTO_INCREMENT_INCREMENT = 2;
|
|
|
|
SET DEBUG_SYNC= 'now WAIT_FOR flushed';
|
|
SET DEBUG_SYNC= 'ib_after_row_insert SIGNAL opened WAIT_FOR flushed1';
|
|
|
|
send INSERT INTO t1 values(NULL);
|
|
|
|
connection default;
|
|
|
|
SET DEBUG_SYNC= 'now WAIT_FOR opened';
|
|
SET DEBUG_SYNC= 'ib_after_row_insert_step SIGNAL flushed1 WAIT_FOR opened1';
|
|
|
|
send INSERT INTO t1 VALUES(NULL);
|
|
|
|
connection con1;
|
|
reap;
|
|
SELECT * FROM t1;
|
|
SHOW CREATE TABLE t1;
|
|
SET DEBUG_SYNC= 'now SIGNAL opened1';
|
|
disconnect con1;
|
|
|
|
connection default;
|
|
reap;
|
|
SELECT * FROM t1;
|
|
SHOW CREATE TABLE t1;
|
|
DROP TABLE t1;
|
|
SET DEBUG_SYNC='RESET';
|