Merge InnoDB test cases from MySQL 5.7 (MDEV-13626)

[MDEV-14348]  deadlock with innodb_autoinc_lock_mode=0 Created: 2017-11-10  Updated: 2023-11-02  Resolved: 2023-11-02

Status: Closed
Project: MariaDB Server
Component/s: Tests
Affects Version/s: 10.2
Fix Version/s: N/A

Type: Technical task Priority: Major
Reporter: Alice Sherepa Assignee: Marko Mäkelä
Resolution: Cannot Reproduce Votes: 0
Labels: None


 Description   

test from mysql 5.7, here https://github.com/MariaDB/server/tree/bb-10.2-alice/mysql-test/suite/innodb/t/innodb_deadlock_with_autoinc.test

innodb.innodb_deadlock_with_autoinc 'innodb' [ fail ]
        Test ended at 2017-11-10 14:00:05
 
CURRENT_TEST: innodb.innodb_deadlock_with_autoinc
mysqltest: At line 44: query 'reap' failed: 1213: Deadlock found when trying to get lock; try restarting transaction
 
The result from queries just before the failure was:
< snip >
# Bug #21983865  UNEXPECTED DEADLOCK WITH INNODB_AUTOINC_LOCK_MODE=0
#
create table t1(f1 int not null auto_increment primary key) engine=innodb;
# Hold autoinc_lock on table t1 from connection con1
connect  con1, localhost, root;
set debug_sync='ib_after_row_insert SIGNAL others WAIT_FOR continue_others';
insert into t1 values(NULL);
connection default;
# Create 40 connections and make it to wait for autoinc_lock on table t1.
# Release the auto_inc lock on table t1 for connection con1
set debug_sync='now SIGNAL continue_others';
# Now all 40 connections can finish the insert operation on t1.
connection default;
disconnect con40;
connection con1;
connection default;
disconnect con1;
connection con2;



 Comments   
Comment by Marko Mäkelä [ 2023-11-02 ]

I can’t reproduce a failure. This test is part of a MySQL bug fix that was applied to the 10.2 branch as part of applying InnoDB changes from MySQL 5.7.14.

The test is starting 40 concurrent connections. I see that it could depend on a MySQL 5.7 enhancement of DEBUG_SYNC that would allow multiple WAIT_FOR on the same signal. Maybe that enhancement was finally ported to MariaDB within the past 2 or 3 years. I do not have a memory of it.

I manually ran the test on a newer major version branch that includes the deadlock checker rewrite MDEV-24738. It does not reproduce a deadlock there either.

I do not think that there is much value in adding this test to the MariaDB regression test suite at this point.

Generated at Thu Feb 08 08:12:51 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.