From e8d1bb045946a1c7b6e53c6b0bf468f9166db893 Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Thu, 30 Dec 2021 13:13:58 +0530 Subject: MDEV-27017 Assertion failure 'table->get_ref_count() == 0' on DDL that involves FULLTEXT INDEX purge_sys.stop_FTS() does not wait for purge operation on FTS tables to finish. InnoDB DDL does purge_sys.stop_FTS() and lock all fts tables. It eventually fails due to n_ref_count value. fts_stop_purge(): Stops the purge thread to process new FTS tables, check n_ref_count of all fts index auxiliary, common tables. This should make sure that consecutive fts_lock_tables() is always successful. --- storage/innobase/include/trx0purge.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'storage/innobase/include/trx0purge.h') diff --git a/storage/innobase/include/trx0purge.h b/storage/innobase/include/trx0purge.h index 417c6688e83..dc032cdf73a 100644 --- a/storage/innobase/include/trx0purge.h +++ b/storage/innobase/include/trx0purge.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, 2021, MariaDB Corporation. +Copyright (c) 2017, 2022, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -283,6 +283,11 @@ public: trx_sys.clone_oldest_view(&view); latch.wr_unlock(); } + + /** Stop the purge thread and check n_ref_count of all auxiliary + and common table associated with the fts table. + @param table parent FTS table */ + void stop_FTS(const dict_table_t &table); }; /** The global data structure coordinating a purge */ -- cgit v1.2.1