Commit 30b917d3 authored by Andrei's avatar Andrei Committed by Andrei Elkin

MDEV-27039 Trying to lock mutex ... when the mutex was already locked

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.
parent 3e030488
......@@ -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");
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment