Hi, Sergey! On Apr 01, Sergey Vojtovich wrote:
revision-id: 6daf451415f (mariadb-10.5.0-69-g6daf451415f) parent(s): c24253d0fa3 author: Sergey Vojtovich <svoj@mariadb.org> committer: Sergey Vojtovich <svoj@mariadb.org> timestamp: 2019-12-25 20:24:24 +0400 message:
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.
Not quite. FTWRL calls flush_tables(thd, FLUSH_ALL), and flush_tables() does extra(HA_EXTRA_FLUSH) + tc_release_table() + tdc_release_share(share) So FTWRL still closes all tables properly.
diff --git a/sql/sql_reload.cc b/sql/sql_reload.cc --- a/sql/sql_reload.cc +++ b/sql/sql_reload.cc @@ -539,16 +538,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; @@ -583,6 +576,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;
Regards, Sergei VP of MariaDB Server Engineering and security@mariadb.org