summaryrefslogtreecommitdiff
path: root/sql/wsrep_schema.cc
diff options
context:
space:
mode:
authorDaniele Sciascia <daniele.sciascia@galeracluster.com>2019-12-11 13:08:06 +0100
committerJan Lindström <jan.lindstrom@mariadb.com>2019-12-11 14:08:06 +0200
commit72a5a4f1d51aca36a8c87b845a7a8fb615a6ca74 (patch)
tree93a4e52bd9915da49cdb4993e773c0220501c7a2 /sql/wsrep_schema.cc
parent7c2c420b70b19cc02b5281127205e876f3919dad (diff)
downloadmariadb-git-72a5a4f1d51aca36a8c87b845a7a8fb615a6ca74.tar.gz
MDEV-20780 Fixes for failures on galera_sr_ddl_master (#1425)
Test galera_sr_ddl_master would sometimes fail due to leftover streaming replication fragments. Rollbacker thread would attempt to open streaming_log table to remove the fragments, but would fail in check_stack_overrun(). Ultimately the check_stack_overrun() failure was caused by rollbacker missing to switch the victim's THD thread stack to rollbacker's thread stack. Also in this patch: - Remove duplicate functionality in rollbacker helper functions, and extract rollbacker fragment removal into function wsrep_remove_streaming_fragments() - Reuse open_for_write() in wsrep_schema::remove_fragments - Partially revert changes to galera_sr_ddl_master test from commit 44a11a7c085f4f5a4042100df0828d54d596103d. Removed unnecessary wait condition and isolation level setting
Diffstat (limited to 'sql/wsrep_schema.cc')
-rw-r--r--sql/wsrep_schema.cc20
1 files changed, 3 insertions, 17 deletions
diff --git a/sql/wsrep_schema.cc b/sql/wsrep_schema.cc
index 066ea124fb7..619a535f916 100644
--- a/sql/wsrep_schema.cc
+++ b/sql/wsrep_schema.cc
@@ -1049,37 +1049,23 @@ int Wsrep_schema::remove_fragments(THD* thd,
Wsrep_schema_impl::wsrep_off wsrep_off(thd);
Wsrep_schema_impl::binlog_off binlog_off(thd);
- /*
- Open SR table for write.
- Adopted from Rpl_info_table_access::open_table()
- */
- uint flags= (MYSQL_OPEN_IGNORE_GLOBAL_READ_LOCK |
- MYSQL_LOCK_IGNORE_GLOBAL_READ_ONLY |
- MYSQL_OPEN_IGNORE_FLUSH |
- MYSQL_LOCK_IGNORE_TIMEOUT);
Query_tables_list query_tables_list_backup;
Open_tables_backup open_tables_backup;
thd->lex->reset_n_backup_query_tables_list(&query_tables_list_backup);
thd->reset_n_backup_open_tables_state(&open_tables_backup);
- TABLE_LIST tables;
- LEX_CSTRING schema_str= { wsrep_schema_str.c_str(), wsrep_schema_str.length() };
- LEX_CSTRING table_str= { sr_table_str.c_str(), sr_table_str.length() };
- tables.init_one_table(&schema_str,
- &table_str, 0, TL_WRITE);
- if (!open_n_lock_single_table(thd, &tables, tables.lock_type, flags))
+ TABLE* frag_table= 0;
+ if (Wsrep_schema_impl::open_for_write(thd, sr_table_str.c_str(), &frag_table))
{
- WSREP_DEBUG("Failed to open SR table for access");
ret= 1;
}
else
{
- tables.table->use_all_columns();
for (std::vector<wsrep::seqno>::const_iterator i= fragments.begin();
i != fragments.end(); ++i)
{
if (remove_fragment(thd,
- tables.table,
+ frag_table,
server_id,
transaction_id, *i))
{