[MDEV-21360] global debug_dbug pre-test value restoration issues Created: 2019-12-19  Updated: 2023-11-27  Resolved: 2020-01-23

Status: Closed
Project: MariaDB Server
Component/s: Tests
Affects Version/s: 10.1, 10.2, 10.3, 10.4, 10.5
Fix Version/s: 10.2.31, 10.3.22, 10.4.12

Type: Bug Priority: Major
Reporter: Andrei Elkin Assignee: Alice Sherepa
Resolution: Fixed Votes: 0
Labels: dbug


 Description   

There are two failure-prone pattern in mtr suite tests that allows for a pre-test
global.debug_dbug value to not be actually restored, though the test intends doing so.

1. Total reset of @@global.debug_dbug at the end of the test, like in
rpl.kill_race_condition leads to a mtr report like

*--- /home2/me/MDB/WTs/10.5/sandbox/RUN_DEBUG/mysql-test/var/tmp/check-mysqld_2.result	2019-12-19 16:25:40.952378912 +0200
+++ /home2/me/MDB/WTs/10.5/sandbox/RUN_DEBUG/mysql-test/var/tmp/check-mysqld_2.reject	2019-12-19 16:25:42.168365805 +0200
@@ -124,9 +124,9 @@
 DEADLOCK_SEARCH_DEPTH_SHORT	4
 DEADLOCK_TIMEOUT_LONG	50000000
 DEADLOCK_TIMEOUT_SHORT	10000
-DEBUG	d,ib_log_checkpoint_avoid
+DEBUG	
 DEBUG_BINLOG_FSYNC_SLEEP	0
-DEBUG_DBUG	d,ib_log_checkpoint_avoid
+DEBUG_DBUG	
 DEBUG_MUTEX_DEADLOCK_DETECTOR	ON
 DEBUG_NO_THREAD_ALARM	OFF
 DEFAULT_PASSWORD_LIFETIME	0
 
mysqltest: Result length mismatch
 
not ok
 
rpl.kill_race_condition 'row'            [ pass ]    787
 
MTR's internal check of the test case 'rpl.kill_race_condition' failed.
This means that the test case does not preserve the state that existed
before the test case was executed.  Most likely the test case did not
do a proper clean-up. It could also be caused by the previous test run
by this thread, if the server wasn't restarted.
no* further _formatting_ is done here

when run with a pre-installed debug_dbug: ./mtr --mysqld = --debug=d,....

2. reset to a "$saved" mtr variable that expands at the assignment

mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test:77:eval SET @@global.debug_dbug= '$old_debug';

to a string whose value is actually variable
e.g 'cos of the pre-installation pattern of p.1.

Resetting should be done either via save/restore through a session @var, see

mysql-test/suite/versioning/t/debug.test:34:set global debug_dbug=@old_dbug;

or instead of the memorization pattern a +/-d,keyword increment and decrement style should be used.
For using the latter without threatening to polute the server error log though we lack
`commit 0b9400d1f54f4ae9b84decf53352850171880f1e
19:47:52 Author: Thayumanavar <thayumanavar.x.sachithanantha@oracle.com (thayumanavar.x.sachithanantha@oracle.com)>
19:47:52 Date: Thu May 2 16:22:57 2013 +0530



 Comments   
Comment by Sergei Golubchik [ 2019-12-19 ]

"+/-d,keyword increment and decrement style" cannot be used until MDEV-21361 is fixed. It's safer to restore from @old_dbug

Comment by Sujatha Sivakumar (Inactive) [ 2020-01-20 ]

Thank you for working on this Alice. The changes look good.

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