[MDEV-14587] dict_stats_process_entry_from_defrag_pool() fails to call dict_table_close() when index==NULL Created: 2017-12-05  Updated: 2020-08-25  Resolved: 2017-12-05

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB, Storage Engine - XtraDB
Affects Version/s: 10.1.1, 10.2.0, 10.3.0
Fix Version/s: 10.1.30, 10.2.12, 10.3.3

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

Issue Links:
Problem/Incident
is caused by MDEV-5834 Merge Kakao Defragmentation implement... Closed

 Description   

The function dict_stats_process_entry_from_defrag_pool() fails to invoke dict_table_close() when an index does not exist in the table (for example because it has been dropped):

	dict_index_t*	index = dict_table_find_index_on_id(table, index_id);
 
	if (index == NULL) {
		return;
	}
 
	/* Check whether index is corrupted */
	if (dict_index_is_corrupted(index)) {
		dict_table_close(table, FALSE, FALSE);
		return;
	}

As you can see above, existing but corrupted indexes are handled correctly.

Failure to release a table handle should cause an infinite wait at some point in InnoDB, at least in DROP TABLE:

2017-12-02 21:06:52 139784064132864 [Warning] InnoDB: Waited 270 seconds for ref-count on table: `db`.`tablename` space: 12345


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