1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

MDEV-34705: Binlog-in-engine: Fix hang with event group of specific size

If the event group fitted in the binlog cache without the GTID event but not
with, the code would attempt to spill part of the GTID event as out-of-band
data, which is not correct. In release builds this would hang the server as
the spilling would try to lock an already owned mutex.

Fix by checking if the GTID event fits, and spilling any non-GTID data as
oob if it does not.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
This commit is contained in:
Kristian Nielsen
2025-06-01 21:46:52 +02:00
parent 36b559fe7d
commit baec2064a1
6 changed files with 101 additions and 20 deletions

View File

@@ -15,5 +15,6 @@ SELECT COUNT(*), SUM(a), SUM(b), SUM(LENGTH(c)) FROM t1;
COUNT(*) SUM(a) SUM(b) SUM(LENGTH(c))
2552 33150 128776 5000383
connection master;
connection master;
DROP TABLE t1;
include/rpl_end.inc

View File

@@ -62,6 +62,20 @@ SELECT COUNT(*), SUM(a), SUM(b), SUM(LENGTH(c)) FROM t1;
SELECT COUNT(*), SUM(a), SUM(b), SUM(LENGTH(c)) FROM t1;
--connection master
# Test various event group sizes close to the binlog cache size.
# There was a bug where if the event group fit in the cache without the GTID
# event, but not with the GTID, then the code would incorrectly attempt to
# spill part of the GTID event as oob data and the server would hang on
# incorrect double locking of LOCK_commit_ordered.
--disable_query_log
--let $i= 50
while ($i > 0) {
eval INSERT INTO t1 VALUES (1000000, $i, REPEAT('#', @@binlog_cache_size - $i*20));
dec $i;
}
--enable_query_log
# Cleanup.
--connection master
DROP TABLE t1;