[MDEV-17043] Purge of indexed virtual columns may cause hang on table-rebuilding DDL Created: 2018-08-23  Updated: 2018-08-23  Resolved: 2018-08-23

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.2.17, 10.3.8
Fix Version/s: 10.2.18, 10.3.9

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: hang

Issue Links:
Problem/Incident
is caused by MDEV-15855 Assertion `mysql_table' failed in inn... Closed
Relates
relates to MDEV-13564 TRUNCATE TABLE and undo tablespace tr... Closed

 Description   

When a table is renamed to an internal #sql2 or #sql-ib name during a table-rebuilding DDL operation such as OPTIMIZE TABLE or ALTER TABLE, and shortly after that a purge operation in an index on virtual columns is attempted, the operation could fail, but purge would fail to release the table reference:

diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index c3a6bd663b3..35e091e0f11 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -21425,6 +21425,7 @@ static TABLE* innodb_acquire_mdl(THD* thd, dict_table_t* table)
 
 	if (!table_name_parse(table->name, db_buf, tbl_buf,
 			      db_buf_len, tbl_buf_len)) {
+		table->release();
 		return NULL;
 	}
 

This bug was found during the development of a backup-friendly TRUNCATE (RENAME, CREATE, DROP) in MDEV-13564. It would occasionally cause the TRUNCATE TABLE statement to hang during the DROP part in the test gcol.innodb_virtual_purge_debug.

A similar hang should be possible in a table-rebuilding ALTER TABLE of a table that had indexed virtual columns before the operation.


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