diff options
author | Kristian Nielsen <knielsen@knielsen-hq.org> | 2017-04-23 10:49:58 +0200 |
---|---|---|
committer | Kristian Nielsen <knielsen@knielsen-hq.org> | 2017-04-23 10:49:58 +0200 |
commit | 89aad233de9371476d9424c7df72d66c37c23e8a (patch) | |
tree | 2da90384958f5b625f7ef401f73a1dcd5f63af5c /sql/slave.cc | |
parent | 1af3165f98b7f8122af1649babc790e844a660df (diff) | |
download | mariadb-git-89aad233de9371476d9424c7df72d66c37c23e8a.tar.gz |
MDEV-12179: Per-engine mysql.gtid_slave_pos table
Intermediate commit.
Move the discovery of mysql.gtid_slave_pos* tables into the SQL thread.
This avoids doing things like opening tables and scanning the mysql
schema for tables inside of the START SLAVE statement, which might
interact badly with existing transaction or table locks.
(Even though START SLAVE is documented to implicitly commit any active
transactions, this appears not to be the case in current code).
Table discovery fits naturally in the SQL thread init code, next to
the loading of mysql.gtid_slave_pos state.
Diffstat (limited to 'sql/slave.cc')
-rw-r--r-- | sql/slave.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/slave.cc b/sql/slave.cc index 443e5b7a5f1..a892bba82c9 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -5279,6 +5279,14 @@ pthread_handler_t handle_slave_sql(void *arg) if (mi->using_gtid != Master_info::USE_GTID_NO || opt_gtid_strict_mode) goto err; } + /* Re-load the set of mysql.gtid_slave_posXXX tables available. */ + if (find_gtid_slave_pos_tables(thd)) + { + rli->report(ERROR_LEVEL, thd->get_stmt_da()->sql_errno(), NULL, + "Error processing replication GTID position tables: %s", + thd->get_stmt_da()->message()); + goto err; + } /* execute init_slave variable */ if (opt_init_slave.length) |