diff options
author | Raghavendra D Prabhu <rprabhu@wnohang.net> | 2015-07-16 05:24:13 -0700 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2016-02-22 17:59:06 -0500 |
commit | 1077eef94273a87a22d656a2fcd4e47413a29aed (patch) | |
tree | 71cd09bae46d3dd98586e94b499d9a45aa0fcb61 /sql/wsrep_hton.cc | |
parent | 5be449d014d0bdab4859409860deec669a1f11f3 (diff) | |
download | mariadb-git-1077eef94273a87a22d656a2fcd4e47413a29aed.tar.gz |
PXC-391: Avoid Total Order Isolation (TOI) for LOCAL sql admin commands.
The admin commands in question are:
> OPTIMIZE
> REPAIR
> ANALYZE
For LOCAL or NO_WRITE_TO_BINLOG invocations of these commands, ie
OPTIMIZE LOCAL TABLE <t1>
they are not binlogged as expected.
Also, in addition, they are not executed under TOI.
Hence, they are not propagated to other nodes.
The effect is same as that of wsrep_on=0.
Also added tests for this.
A WSREP_DEBUG for wsrep_register_hton has also been added.
The galera_flush_local test has also been updated for verifying that effects
of NO_WRITE_TO_BINLOG / LOCAL are equivalent to wsrep_on=0 from wsrep
perspective.
(cherry picked from commit 5065122f94a8002d4da231528a46f8d9ddbffdc2)
Conflicts:
sql/sql_admin.cc
sql/sql_reload.cc
sql/wsrep_hton.cc
Diffstat (limited to 'sql/wsrep_hton.cc')
-rw-r--r-- | sql/wsrep_hton.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sql/wsrep_hton.cc b/sql/wsrep_hton.cc index c096d2610eb..812d64c8c82 100644 --- a/sql/wsrep_hton.cc +++ b/sql/wsrep_hton.cc @@ -69,6 +69,17 @@ void wsrep_register_hton(THD* thd, bool all) { if (thd->wsrep_exec_mode != TOTAL_ORDER && !thd->wsrep_apply_toi) { + if (thd->wsrep_exec_mode == LOCAL_STATE && + (thd_sql_command(thd) == SQLCOM_OPTIMIZE || + thd_sql_command(thd) == SQLCOM_ANALYZE || + thd_sql_command(thd) == SQLCOM_REPAIR) && + thd->lex->no_write_to_binlog == 1) + { + WSREP_DEBUG("Skipping wsrep_register_hton for LOCAL sql admin command : %s", + thd->query()); + return; + } + THD_TRANS *trans=all ? &thd->transaction.all : &thd->transaction.stmt; for (Ha_trx_info *i= trans->ha_list; WSREP(thd) && i; i = i->next()) { |