[MDEV-30955] Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->s->db.str, table->s->table_name.str, MDL_SHARED)' failed in close_thread_table Created: 2022-02-24  Updated: 2023-04-18  Resolved: 2023-04-18

Status: Closed
Project: MariaDB Server
Component/s: Galera
Affects Version/s: 10.4
Fix Version/s: 11.1.1, 10.11.3, 10.4.29, 10.5.20, 10.6.13, 10.8.8, 10.9.6, 10.10.4

Type: Bug Priority: Critical
Reporter: Ramesh Sivaraman Assignee: Julius Goryavsky
Resolution: Fixed Votes: 0
Labels: debug, regression


 Description   

--source include/galera_cluster.inc
CREATE TABLE t (a CHAR(1) KEY);
START TRANSACTION;
HANDLER t OPEN;
--disconnect node_1

Leads to

mysqld: /home/sciascid/Workspace/src/mariadb-server-test/sql/sql_base.cc:1054: void close_thread_table(THD*, TABLE**): Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->s->db.str, table->s->table_name.str, MDL_SHARED)' failed.



 Comments   
Comment by Daniele Sciascia [ 2022-04-14 ]

This bug is not XA specific. The same reproduces on 10.4 as well, using regular transactions:

CREATE TABLE t (a CHAR(1) KEY);
START TRANSACTION;
HANDLER t OPEN;

The above fails in the exact same way.

Comment by Roel Van de Paar [ 2022-05-27 ]

Confirmed not present in CS nor MS.

Comment by Roel Van de Paar [ 2022-05-27 ]

This does not crash in ES without Galera.

10.6.8-4 fe635c6c7a7e835f4a55fe1b23820dd14a647344 (Debug)

10.6.8-dbg>CREATE TABLE t (a CHAR(1) KEY);
Query OK, 0 rows affected (0.017 sec)
 
10.6.8-dbg>START TRANSACTION;
Query OK, 0 rows affected (0.000 sec)
 
10.6.8-dbg>HANDLER t OPEN;
Query OK, 0 rows affected (0.001 sec)

10.6.8-4 fe635c6c7a7e835f4a55fe1b23820dd14a647344 (Debug)

10.6.8-dbg>CREATE TABLE t (a CHAR(1) KEY);
Query OK, 0 rows affected (0.016 sec)
 
10.6.8-dbg>XA START 'a';
Query OK, 0 rows affected (0.000 sec)
 
10.6.8-dbg>HANDLER t OPEN;
Query OK, 0 rows affected (0.001 sec)

Comment by Jan Lindström [ 2023-04-17 ]

https://github.com/MariaDB/server/pull/2587

Comment by Julius Goryavsky [ 2023-04-18 ]

Fix merged with head revision, https://github.com/MariaDB/server/commit/feeeacc4d747868c234425dc12c157c6e5fa8fbb

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