[MDEV-25961] DEBUG_SYNC cannot handle two signals in a row for multiple threads Created: 2021-06-18  Updated: 2023-11-28

Status: Open
Project: MariaDB Server
Component/s: Debug
Affects Version/s: 10.6
Fix Version/s: 10.11

Type: Bug Priority: Minor
Reporter: Michael Widenius Assignee: Michael Widenius
Resolution: Unresolved Votes: 0
Labels: None


 Description   

The current DBUG_SYNC implementation does not support two 'now SIGNAL xxx' commands
in a row for multiple threads as the first one can get lost while
the waiting threads are sleeping on mysql_cond_timedwait().

This was the reason why deadlock_drop_table.test was failing.

One reason for this is that the signal name is stored in a global variable
that is overwritten. A better way would be to store all signals in
an array together with a 'time' when the signal was sent. This array
should be checked on broadcast.

A workaround for test that uses DEBUG_SYNC with multiple connections is to signal all threads with the same signal. This avoids the issue.

Until this is fixed, you should not use the following in MTR tests:

set debug_sync='now SIGNAL go2';
set debug_sync='now SIGNAL go3';

Update: MySQL 5.7+ has fixed this (and added a lot of comments to debug_sync.cc, which is good!)

The easiest way to fix this bug is to backport the latest debug_sync.cc from MySQL to MariaDB.


Generated at Thu Feb 08 09:41:42 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.