diff options
author | Andrei <andrei.elkin@mariadb.com> | 2021-12-27 12:36:51 +0200 |
---|---|---|
committer | Andrei Elkin <andrei.elkin@mariadb.com> | 2022-01-03 13:24:50 +0200 |
commit | 30b917d34adc27e55a1326406a22e2a6d0a87817 (patch) | |
tree | 0575f29b00bca098e4f92eb560582fd08f1f5f1f | |
parent | 3e0304884b45d143e4194b3244d6e77a663680fc (diff) | |
download | mariadb-git-bb-10.6-andrei.tar.gz |
MDEV-27039 Trying to lock mutex ... when the mutex was already lockedbb-10.6-andrei
The reason of the double lock was an extraneous ha_flush_logs().
Unlike the upstream it is unnecessary in Mariadb that exploits a binlog
checkpoint mechanism for not letting PURGE or RESET-MASTER to trouble
transaction recovery. That is in case should a trx
be prepared but its binlog file gone, the trx then is committed on disk too.
Those facts have been always verified by existing tests of
binlog.binlog_{checkpoint,xa_recover}.test.
A regression test for the bug is included though.
-rw-r--r-- | sql/log.cc | 1 | ||||
-rw-r--r-- | storage/spider/mysql-test/spider/r/spider_fixes.result | 7 | ||||
-rw-r--r-- | storage/spider/mysql-test/spider/t/spider_fixes.test | 15 |
3 files changed, 22 insertions, 1 deletions
diff --git a/sql/log.cc b/sql/log.cc index 41eed80ef66..8df7c3f5275 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -7029,7 +7029,6 @@ void MYSQL_BIN_LOG::purge() DBUG_EXECUTE_IF("expire_logs_always", { purge_time = my_time(0); }); if (purge_time >= 0) { - ha_flush_logs(); purge_logs_before_date(purge_time); } DEBUG_SYNC(current_thd, "after_purge_logs_before_date"); diff --git a/storage/spider/mysql-test/spider/r/spider_fixes.result b/storage/spider/mysql-test/spider/r/spider_fixes.result index 1db31ca9f95..b2a2fad5238 100644 --- a/storage/spider/mysql-test/spider/r/spider_fixes.result +++ b/storage/spider/mysql-test/spider/r/spider_fixes.result @@ -596,6 +596,13 @@ connection child2_1; DROP DATABASE IF EXISTS auto_test_remote; connection child2_2; DROP DATABASE IF EXISTS auto_test_remote2; +connection master_1; +SET @@global.expire_logs_days=11; +connect master_purge, localhost, root, , , $MASTER_1_MYPORT, $MASTER_1_MYSOCK; +SET @@global.binlog_checksum=NONE; +SET @@global.binlog_checksum=$binlog_checksum; +SET @@global.expire_logs_days=$expire_logs_days; +disconnect master_purge; for slave1_1 for master_1 for child2 diff --git a/storage/spider/mysql-test/spider/t/spider_fixes.test b/storage/spider/mysql-test/spider/t/spider_fixes.test index 9f7ada052ed..56e143060e6 100644 --- a/storage/spider/mysql-test/spider/t/spider_fixes.test +++ b/storage/spider/mysql-test/spider/t/spider_fixes.test @@ -1410,6 +1410,21 @@ if ($USE_CHILD_GROUP2) --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; } + + +# MDEV-27039 LOCK_global_system_variables attempted to re-acquire +# The test proves no assert anymore. +--connection master_1 +--let $binlog_checksum=`SELECT @@global.binlog_checksum` +--let $expire_logs_days=`SELECT @@global.expire_logs_days` +SET @@global.expire_logs_days=11; + +--connect (master_purge, localhost, root, , , $MASTER_1_MYPORT, $MASTER_1_MYSOCK) +SET @@global.binlog_checksum=NONE; +--evalp SET @@global.binlog_checksum=$binlog_checksum +--evalp SET @@global.expire_logs_days=$expire_logs_days +--disconnect master_purge + --disable_query_log --disable_result_log --source slave_test_deinit.inc |