mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Implement multiple-signal debug_sync
The patch is inspired from MySQL. Instead of using a single String to hold the current active debug_sync signal, use a Hash_set to store LEX_STRINGS. This patch ensures that a signal can not be lost, by being overwritten by another thread via set DEBUG_SYNC = '... SIGNAL ...'; All signals are kepts "alive" until they are consumed by a wait event. This requires updating test cases that assume the GLOBAL signal is never consumed. Follow-up work needed: Port the additional syntax that allows one to set multiple signals and also conditionally deactivate signals when waiting.
This commit is contained in:
@ -298,6 +298,16 @@ SET DEBUG_SYNC= 'p9abcdef TEST';
|
||||
SHOW VARIABLES LIKE 'DEBUG_SYNC';
|
||||
SET DEBUG_SYNC= 'p3abcdef TEST';
|
||||
SHOW VARIABLES LIKE 'DEBUG_SYNC';
|
||||
|
||||
#
|
||||
# Wait for all signals currently active except s3.
|
||||
#
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR s9';
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR s1';
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR s4';
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR s7';
|
||||
SHOW VARIABLES LIKE 'DEBUG_SYNC';
|
||||
|
||||
#
|
||||
# Clear the actions.
|
||||
#
|
||||
@ -320,7 +330,7 @@ SHOW VARIABLES LIKE 'DEBUG_SYNC';
|
||||
SET DEBUG_SYNC= 'p9abcdef TEST';
|
||||
SHOW VARIABLES LIKE 'DEBUG_SYNC';
|
||||
#
|
||||
# Now cleanup. Actions are clear already, but signal needs to be cleared.
|
||||
# Now cleanup. Actions are clear already, but s3 signal needs to be cleared.
|
||||
#
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
SHOW VARIABLES LIKE 'DEBUG_SYNC';
|
||||
|
Reference in New Issue
Block a user