1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +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

@@ -851,6 +851,11 @@ THD::THD(my_thread_id id, bool is_wsrep_applier)
query_id= 0;
query_name_consts= 0;
semisync_info= 0;
#ifndef DBUG_OFF
expected_semi_sync_offs= 0;
#endif
db_charset= global_system_variables.collation_database;
bzero((void*) ha_data, sizeof(ha_data));
mysys_var=0;