[MDEV-27523] main.delayed fails with wrong error code or timeout when executed after main.deadlock_ftwrl Created: 2022-01-17  Updated: 2023-10-17  Resolved: 2023-10-17

Status: Closed
Project: MariaDB Server
Component/s: Tests
Affects Version/s: 10.4, 10.5, 10.6, 10.7, 10.8, 10.9
Fix Version/s: 10.4.32, 10.5.23, 10.6.16, 10.10.7, 10.11.6, 11.0.4, 11.1.3

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None


 Description   

When main.delayed is run after main.deadlock_ftwrl, it fails, seemingly reliably, with "succeeded - should have failed with errno 1213":

10.4 5e04c08d

perl ./mtr --mem --noreorder main.deadlock_ftwrl main.delayed
 
main.deadlock_ftwrl                      [ pass ]     14
main.delayed                             [ fail ]
        Test ended at 2022-01-17 02:29:06
 
CURRENT_TEST: main.delayed
mysqltest: At line 494: query 'INSERT DELAYED INTO t1 VALUES (4)' succeeded - should have failed with errno 1213...
 
The result from queries just before the failure was:
< snip >
connection con1;
# Sending:
ALTER TABLE t1 MODIFY a INT UNSIGNED;;
connection default;
# Wait until ALTER TABLE is blocked on table 't1'.
INSERT DELAYED INTO t1 VALUES (3);
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
COMMIT;
connection con1;
# Reaping: ALTER TABLE t1 COMMENT 'test'
# Test 3: Using RENAME TABLE
connection default;
START TRANSACTION;
INSERT INTO t2 VALUES (1);
connection con1;
# Sending:
RENAME TABLE t1 to t5, t2 to t4;
connection default;
# Wait until RENAME TABLE is blocked on table 't1'.
INSERT DELAYED INTO t1 VALUES (4);

With one more test in the chain it hangs instead, also seemingly reliably:

perl ./mtr --mem --noreorder main.ddl_i18n_koi8r main.deadlock_ftwrl main.delayed
 
main.ddl_i18n_koi8r                      [ pass ]    733
main.deadlock_ftwrl                      [ pass ]      8
worker[1] Trying to dump core for [mysqltest - pid: 3093574, winpid: 3093574]
worker[1] Trying to dump core for [mysqld.1 - pid: 3093506, winpid: 3093506]
main.delayed                             [ fail ]  timeout after 120 seconds

main.deadlock_ftwrl was added in 10.4 by this commit:

commit fa5f60681fe4ed9d5bb160e551381cb7b1be5850
Author: Rinat Ibragimov
Date:   Thu Jun 18 01:11:39 2020 +0300
 
    MDEV-20946: Hard FTWRL deadlock under user level locks

I suppose the chain of tests has been failing ever since, but I didn't check.



 Comments   
Comment by Marko Mäkelä [ 2022-03-21 ]

This also fails in 10.9 MemorySanitizer pretty often:

main.deadlock_ftwrl                      w5 [ pass ]     56
main.debug_sync                          w5 [ pass ]    188
main.default_debug                       w5 [ pass ]     19
main.ddl_i18n_koi8r                      w2 [ pass ]   3677
main.default_session                     w5 [ pass ]    145
main.ddl_i18n_utf8                       w6 [ pass ]   3919
main.default_storage_engine              w2 [ pass ]   1045
main.ctype_utf8mb4_uca_allkeys400        w4 [ pass ]  24118
main.ctype_utf8mb4_uca_allkeys520        w1 [ pass ]  33034
stress.ddl_innodb 'innodb'               w3 [ pass ]  185330
worker[5] Trying to dump core for [mysqltest - pid: 306085, winpid: 306085]
worker[5] Trying to dump core for [mysqld.1 - pid: 305590, winpid: 305590]
main.delayed                             w5 [ fail ]  timeout after 900 seconds

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