1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Let "FTWRL <table_list>" use extra(HA_EXTRA_FLUSH)

Rather than flushing caches with tdc_remove_table(TDC_RT_REMOVE_UNUSED)
flush them with extra(HA_EXTRA_FLUSH) instead. This goes inline with
regular FTWRL.

Part of MDEV-17882 - Cleanup refresh version
This commit is contained in:
Sergey Vojtovich
2019-12-18 01:18:19 +04:00
parent 0870b75af7
commit e0743bd1a5
5 changed files with 13 additions and 291 deletions

View File

@ -512,7 +512,6 @@ bool reload_acl_and_cache(THD *thd, unsigned long long options,
bool flush_tables_with_read_lock(THD *thd, TABLE_LIST *all_tables)
{
Lock_tables_prelocking_strategy lock_tables_prelocking_strategy;
TABLE_LIST *table_list;
/*
This is called from SQLCOM_FLUSH, the transaction has
@ -545,16 +544,10 @@ bool flush_tables_with_read_lock(THD *thd, TABLE_LIST *all_tables)
DEBUG_SYNC(thd,"flush_tables_with_read_lock_after_acquire_locks");
for (table_list= all_tables; table_list;
/* Reset ticket to satisfy asserts in open_tables(). */
for (auto table_list= all_tables; table_list;
table_list= table_list->next_global)
{
/* Request removal of table from cache. */
tdc_remove_table(thd, TDC_RT_REMOVE_UNUSED,
table_list->db.str,
table_list->table_name.str);
/* Reset ticket to satisfy asserts in open_tables(). */
table_list->mdl_request.ticket= NULL;
}
}
thd->variables.option_bits|= OPTION_TABLE_LOCK;
@ -589,6 +582,16 @@ bool flush_tables_with_read_lock(THD *thd, TABLE_LIST *all_tables)
}
}
if (thd->lex->type & REFRESH_READ_LOCK)
{
for (auto table_list= all_tables; table_list;
table_list= table_list->next_global)
{
if (table_list->table->file->extra(HA_EXTRA_FLUSH))
goto error_reset_bits;
}
}
if (thd->locked_tables_list.init_locked_tables(thd))
goto error_reset_bits;