[MDEV-16709] InnoDB: Error: trx already had an AUTO-INC lock Created: 2018-07-08  Updated: 2018-09-04  Resolved: 2018-09-04

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.1.32, 10.2.14, 10.3.6
Fix Version/s: 10.1.36, 10.2.18, 10.3.10

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Marko Mäkelä
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates MDEV-13333 Deadlock failure that does not occur ... Closed

 Description   

--source include/have_innodb.inc
--source include/have_partition.inc
 
CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB PARTITION BY key (pk) PARTITIONS 2;
 
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
INSERT INTO t2 VALUES (1),(2),(3),(4),(5),(6);
 
CREATE TABLE t3 (b INT) ENGINE=InnoDB;
INSERT INTO t3 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9);
 
--connect (con1,localhost,root,,test)
--send
  INSERT t1 SELECT NULL FROM t2;
 
--connection default
--error 0,ER_LOCK_DEADLOCK
INSERT t1 SELECT NULL FROM t3;
 
--connection con1
--error 0,ER_LOCK_DEADLOCK
--reap
 
# Cleanup
--disconnect con1
--connection default
DROP TABLE t1, t2, t3;

10.1 1d10c9afe0f2f

line
InnoDB: Error: trx already had an AUTO-INC lock!
^ Found warnings in /data/bld/10.1/mysql-test/var/log/mysqld.1.err
ok

The error started appearing in 10.1 tree with this commit:

commit 723f87e9d318aedad30dfb9dde104312d6612662
Author: Marko Mäkelä
Date:   Wed Mar 14 09:39:47 2018 +0200
 
    lock_table_create(), lock_rec_create(): Clean up the WSREP code
    
    By definition, c_lock->trx->lock.wait_lock==c_lock cannot hold.
    That is, the owner transaction of a lock cannot be waiting for that
    particular lock. It must have been waiting for some other lock.
    Remove the dead code related to that. Also, test c_lock for NULLness
    only once.



 Comments   
Comment by Marko Mäkelä [ 2018-09-04 ]

This issue has been fixed as MDEV-13333. I checked that the test fails with the parent of MDEV-13333, and no longer fails with the MDEV-13333 fix.

Comment by Marko Mäkelä [ 2018-09-04 ]

This shares the same cause and fix with MDEV-13333. I pushed the test case only.

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