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

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
This commit is contained in:
Raghavendra D Prabhu
2015-07-16 05:24:13 -07:00
committed by Nirbhay Choubey
parent 5be449d014
commit 1077eef942
8 changed files with 352 additions and 3 deletions

View File

@ -1175,6 +1175,7 @@ bool Sql_cmd_analyze_table::execute(THD *thd)
if (check_table_access(thd, SELECT_ACL | INSERT_ACL, first_table,
FALSE, UINT_MAX, FALSE))
goto error;
WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, first_table);
thd->enable_slow_log= opt_log_slow_admin_statements;
#ifdef WITH_WSREP
WSREP_TO_ISOLATION_BEGIN(first_table->db, first_table->table_name, NULL);
@ -1233,7 +1234,7 @@ bool Sql_cmd_optimize_table::execute(THD *thd)
if (check_table_access(thd, SELECT_ACL | INSERT_ACL, first_table,
FALSE, UINT_MAX, FALSE))
goto error; /* purecov: inspected */
WSREP_TO_ISOLATION_BEGIN(first_table->db, first_table->table_name, NULL)
WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, first_table);
thd->enable_slow_log= opt_log_slow_admin_statements;
res= (specialflag & SPECIAL_NO_NEW_FUNC) ?
mysql_recreate_table(thd, first_table, true) :
@ -1267,7 +1268,7 @@ bool Sql_cmd_repair_table::execute(THD *thd)
FALSE, UINT_MAX, FALSE))
goto error; /* purecov: inspected */
thd->enable_slow_log= opt_log_slow_admin_statements;
WSREP_TO_ISOLATION_BEGIN(first_table->db, first_table->table_name, NULL)
WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, first_table);
res= mysql_admin_table(thd, first_table, &m_lex->check_opt, "repair",
TL_WRITE, 1,
MY_TEST(m_lex->check_opt.sql_flags & TT_USEFRM),