Skip to content
Permalink
Browse files
MDEV-29853 Assertion `!strstr(table->name.m_name, "/FTS_") || purge_s…
…ys.must_wait_FTS()' failed in trx_t::commit

  - Failing debug assertion is to indicate whether the purge thread
is waiting when fts auxilary table is being dropped. But assertion
fails if the table name contains FTS_. So in fts_drop_table(), InnoDB
sets the auxilary table flag in transaction modified table list.
  • Loading branch information
Thirunarayanan committed Nov 8, 2022
1 parent 689e951 commit db85d8b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
@@ -267,8 +267,7 @@ void trx_t::commit(std::vector<pfs_os_file_t> &deleted)
if (btr_defragment_active)
btr_defragment_remove_table(table);
const fil_space_t *space= table->space;
ut_ad(!strstr(table->name.m_name, "/FTS_") ||
purge_sys.must_wait_FTS());
ut_ad(!p.second.is_aux_table() || purge_sys.must_wait_FTS());
dict_sys.remove(table);
if (const auto id= space ? space->id : 0)
{
@@ -1373,6 +1373,13 @@ static dberr_t fts_drop_table(trx_t *trx, const char *table_name, bool rename)
return err;
}

#ifdef UNIV_DEBUG
for (auto &p : trx->mod_tables)
{
if (p.first == table)
p.second.set_aux_table();
}
#endif /* UNIV_DEBUG */
return DB_SUCCESS;
}

@@ -429,6 +429,10 @@ class trx_mod_table_time_t
/** First modification of a system versioned column
(NONE= no versioning, BULK= the table was dropped) */
undo_no_t first_versioned= NONE;
#ifdef UNIV_DEBUG
/** Whether the modified table is a FTS auxiliary table */
bool fts_aux_table= false;
#endif /* UNIV_DEBUG */
public:
/** Constructor
@param rows number of modified rows so far */
@@ -483,6 +487,12 @@ class trx_mod_table_time_t
first_versioned= NONE;
return false;
}

#ifdef UNIV_DEBUG
void set_aux_table() { fts_aux_table= true; }

bool is_aux_table() const { return fts_aux_table; }
#endif /* UNIV_DEBUG */
};

/** Collection of persistent tables and their first modification

0 comments on commit db85d8b

Please sign in to comment.