1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-34122: Assertion `entry' failed in Active_tranx::assert_thd_is_waiter

If semi-sync is switched off then on while a transaction is
in-between binlogging and waiting for an ACK, the semi-sync state of
the transaction is removed, leading to a debug assertion that
indicates the transaction tried to wait, but cannot receive an ACK
signal. More specifically, when semi-sync is switched off, the
Active_tranx list is cleared (where a transaction adds an entry to
this list during binlogging), and each entry in this list saves the
thread which will wait for an ACK, and the thread has the COND
variable to signal to wake itself. So if the entry is lost, the
Ack_receiver thread won’t be able to find the thread to wake up when
an ACK comes in

The fix is to ensure that the entry exists before awaiting the ACK,
and if there is no entry, skip the wait. In debug builds, an
informative message is written explaining that the transaction is
skipping its wait. Additional debug-build only logic is added to
ensure that the cause of the missing entry is due to semi-sync being
turned off and on

Reviewed By:
============
Kristian Nielsen <knielsen@knielsen-hq.org>
This commit is contained in:
Brandon Nesterenko
2024-09-23 08:18:55 -06:00
parent e8db5c8760
commit 1ed30e08af
6 changed files with 243 additions and 18 deletions

View File

@ -2922,6 +2922,17 @@ public:
/* Needed by MariaDB semi sync replication */
Trans_binlog_info *semisync_info;
#ifndef DBUG_OFF
/*
If Active_tranx is missing an entry for a transaction which is planning to
await an ACK, this ensures that the reason is because semi-sync was turned
off then on in-between the binlogging of the transaction, and before it had
started waiting for the ACK.
*/
ulong expected_semi_sync_offs;
#endif
/* If this is a semisync slave connection. */
bool semi_sync_slave;
ulonglong client_capabilities; /* What the client supports */