revive innodb_debug_sync
innodb_debug_sync was introduced in commit b393e2cb0c079b30563dcc87a62002c9c778643c and reverted in commit fc58c1721631fcc6c9414482b3b7e90cd8e7325d due to memory leak reported by valgrind, see MDEV-21336. The leak is now fixed by adding `rw_lock_free(&slot->debug_sync_lock)` after background thread working loop is finished, and the patch is reapplied, with respect to c++98 fixes by Marko. The missing DEBUG_SYNC for MDEV-18546 in row0vers.cc is also reapplied.
This commit is contained in:
parent
a35cde8cd8
commit
300253acf1
@ -233,3 +233,47 @@ set global debug_dbug= @saved_dbug;
|
||||
drop table t1;
|
||||
set debug_sync=reset;
|
||||
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
|
||||
#
|
||||
# MDEV-18546 ASAN heap-use-after-free
|
||||
# in innobase_get_computed_value / row_purge
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
pk INT AUTO_INCREMENT,
|
||||
b BIT(15),
|
||||
v BIT(15) AS (b) VIRTUAL,
|
||||
PRIMARY KEY(pk),
|
||||
UNIQUE(v)
|
||||
) ENGINE=InnoDB;
|
||||
INSERT IGNORE INTO t1 (b) VALUES
|
||||
(NULL),(b'011'),(b'000110100'),
|
||||
(b'01101101010'),(b'01111001001011'),(NULL);
|
||||
SET GLOBAL innodb_debug_sync = "ib_clust_v_col_before_row_allocated "
|
||||
"SIGNAL before_row_allocated "
|
||||
"WAIT_FOR flush_unlock";
|
||||
SET GLOBAL innodb_debug_sync = "ib_open_after_dict_open "
|
||||
"SIGNAL purge_open "
|
||||
"WAIT_FOR select_open";
|
||||
set global debug_dbug= "d,ib_purge_virtual_index_callback";
|
||||
connect purge_waiter,localhost,root;
|
||||
SET debug_sync= "now WAIT_FOR before_row_allocated";
|
||||
connection default;
|
||||
REPLACE INTO t1 (pk, b) SELECT pk, b FROM t1;
|
||||
connection purge_waiter;
|
||||
connection default;
|
||||
disconnect purge_waiter;
|
||||
FLUSH TABLES;
|
||||
SET GLOBAL innodb_debug_sync = reset;
|
||||
SET debug_sync= "now SIGNAL flush_unlock WAIT_FOR purge_open";
|
||||
SET GLOBAL innodb_debug_sync = reset;
|
||||
SET debug_sync= "ib_open_after_dict_open SIGNAL select_open";
|
||||
SELECT * FROM t1;
|
||||
pk b v
|
||||
1 NULL NULL
|
||||
2 |