summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/mysql/service_wsrep.h6
-rw-r--r--sql/handler.cc12
-rw-r--r--sql/rpl_gtid.cc4
-rw-r--r--sql/sql_class.cc2
-rw-r--r--sql/sql_class.h7
-rw-r--r--sql/sql_plugin_services.ic2
-rw-r--r--sql/wsrep_dummy.cc2
-rw-r--r--sql/wsrep_mysqld.cc4
-rw-r--r--storage/innobase/handler/ha_innodb.cc6
-rw-r--r--storage/xtradb/handler/ha_innodb.cc6
10 files changed, 31 insertions, 20 deletions
diff --git a/include/mysql/service_wsrep.h b/include/mysql/service_wsrep.h
index 6b332f89958..bc5b2c67cdc 100644
--- a/include/mysql/service_wsrep.h
+++ b/include/mysql/service_wsrep.h
@@ -104,7 +104,7 @@ extern struct wsrep_service_st {
const char * (*wsrep_thd_query_state_str_func)(THD *thd);
int (*wsrep_thd_retry_counter_func)(THD *thd);
void (*wsrep_thd_set_conflict_state_func)(THD *thd, enum wsrep_conflict_state state);
- bool (*wsrep_thd_skip_append_keys_func)(THD *thd);
+ bool (*wsrep_thd_ignore_table_func)(THD *thd);
long long (*wsrep_thd_trx_seqno_func)(THD *thd);
struct wsrep_ws_handle * (*wsrep_thd_ws_handle_func)(THD *thd);
int (*wsrep_trx_is_aborting_func)(MYSQL_THD thd);
@@ -145,7 +145,7 @@ extern struct wsrep_service_st {
#define wsrep_thd_query_state_str(T) wsrep_service->wsrep_thd_query_state_str_func(T)
#define wsrep_thd_retry_counter(T) wsrep_service->wsrep_thd_retry_counter_func(T)
#define wsrep_thd_set_conflict_state(T,S) wsrep_service->wsrep_thd_set_conflict_state_func(T,S)
-#define wsrep_thd_skip_append_keys(T) wsrep_service->wsrep_thd_skip_append_keys_func(T)
+#define wsrep_thd_ignore_table(T) wsrep_service->wsrep_thd_ignore_table_func(T)
#define wsrep_thd_trx_seqno(T) wsrep_service->wsrep_thd_trx_seqno_func(T)
#define wsrep_thd_ws_handle(T) wsrep_service->wsrep_thd_ws_handle_func(T)
#define wsrep_trx_is_aborting(T) wsrep_service->wsrep_trx_is_aborting_func(T)
@@ -206,7 +206,7 @@ void wsrep_thd_LOCK(THD *thd);
void wsrep_thd_UNLOCK(THD *thd);
void wsrep_thd_awake(THD *thd, my_bool signal);
void wsrep_thd_set_conflict_state(THD *thd, enum wsrep_conflict_state state);
-bool wsrep_thd_skip_append_keys(THD *thd);
+bool wsrep_thd_ignore_table(THD *thd);
void wsrep_unlock_rollback();
#endif
diff --git a/sql/handler.cc b/sql/handler.cc
index 4e6dfb7bfae..748ea21b4f7 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -5723,10 +5723,16 @@ static int binlog_log_row(TABLE* table,
bool error= 0;
THD *const thd= table->in_use;
- /* only InnoDB tables will be replicated through binlog emulation */
- if (WSREP_EMULATE_BINLOG(thd) &&
- table->file->partition_ht()->db_type != DB_TYPE_INNODB)
+#ifdef WITH_WSREP
+ /*
+ Only InnoDB tables will be replicated through binlog emulation. Also
+ updates in mysql.gtid_slave_state table should not be binlogged.
+ */
+ if ((WSREP_EMULATE_BINLOG(thd) &&
+ table->file->partition_ht()->db_type != DB_TYPE_INNODB) ||
+ (thd->wsrep_ignore_table == true))
return 0;
+#endif /* WITH_WSREP */
if (check_table_binlog_row_based(thd, table))
{
diff --git a/sql/rpl_gtid.cc b/sql/rpl_gtid.cc
index 47c0f4e3fb7..f54ef2b0081 100644
--- a/sql/rpl_gtid.cc
+++ b/sql/rpl_gtid.cc
@@ -567,7 +567,7 @@ rpl_slave_state::record_gtid(THD *thd, const rpl_gtid *gtid, uint64 sub_id,
Updates in slave state table should not be appended to galera transaction
writeset.
*/
- thd->wsrep_skip_append_keys= true;
+ thd->wsrep_ignore_table= true;
#endif
if (!in_transaction)
@@ -685,7 +685,7 @@ IF_DBUG(dbug_break:, )
end:
#ifdef WITH_WSREP
- thd->wsrep_skip_append_keys= false;
+ thd->wsrep_ignore_table= false;
#endif
if (table_opened)
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 48b5b502c51..d2ebbc64c47 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -902,7 +902,7 @@ THD::THD(bool is_wsrep_applier)
wsrep_po_handle(WSREP_PO_INITIALIZER),
wsrep_po_cnt(0),
wsrep_apply_format(0),
- wsrep_skip_append_keys(false)
+ wsrep_ignore_table(false)
#endif
{
ulong tmp;
diff --git a/sql/sql_class.h b/sql/sql_class.h
index bf16b119be2..ac2b666c9e9 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -3990,7 +3990,12 @@ public:
#endif /* GTID_SUPPORT */
void *wsrep_apply_format;
char wsrep_info[128]; /* string for dynamic proc info */
- bool wsrep_skip_append_keys;
+ /*
+ When enabled, do not replicate/binlog updates from the current table that's
+ being processed. At the moment, it is used to keep mysql.gtid_slave_pos
+ table updates from being replicated to other nodes via galera replication.
+ */
+ bool wsrep_ignore_table;
wsrep_gtid_t wsrep_sync_wait_gtid;
#endif /* WITH_WSREP */
diff --git a/sql/sql_plugin_services.ic b/sql/sql_plugin_services.ic
index da0cc17250b..c3dfde18ab6 100644
--- a/sql/sql_plugin_services.ic
+++ b/sql/sql_plugin_services.ic
@@ -133,7 +133,7 @@ static struct wsrep_service_st wsrep_handler = {
wsrep_thd_query_state_str,
wsrep_thd_retry_counter,
wsrep_thd_set_conflict_state,
- wsrep_thd_skip_append_keys,
+ wsrep_thd_ignore_table,
wsrep_thd_trx_seqno,
wsrep_thd_ws_handle,
wsrep_trx_is_aborting,
diff --git a/sql/wsrep_dummy.cc b/sql/wsrep_dummy.cc
index 603cd8ec5ea..0aa7f9b0aad 100644
--- a/sql/wsrep_dummy.cc
+++ b/sql/wsrep_dummy.cc
@@ -116,7 +116,7 @@ int wsrep_thd_retry_counter(THD *)
void wsrep_thd_set_conflict_state(THD *, enum wsrep_conflict_state)
{ }
-bool wsrep_thd_skip_append_keys(THD *)
+bool wsrep_thd_ignore_table(THD *)
{ return 0; }
longlong wsrep_thd_trx_seqno(THD *)
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index 83120ddc8b2..1d96176a70d 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -2377,9 +2377,9 @@ int wsrep_thd_retry_counter(THD *thd)
}
-extern "C" bool wsrep_thd_skip_append_keys(THD *thd)
+extern "C" bool wsrep_thd_ignore_table(THD *thd)
{
- return thd->wsrep_skip_append_keys;
+ return thd->wsrep_ignore_table;
}
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 30df2c63060..62be0d5219d 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -8303,7 +8303,7 @@ report_error:
wsrep_thd_exec_mode(user_thd) == LOCAL_STATE &&
wsrep_on(user_thd) &&
!wsrep_consistency_check(user_thd) &&
- !wsrep_thd_skip_append_keys(user_thd))
+ !wsrep_thd_ignore_table(user_thd))
{
if (wsrep_append_keys(user_thd, false, record, NULL))
{
@@ -8825,7 +8825,7 @@ func_exit:
if (error == DB_SUCCESS &&
wsrep_thd_exec_mode(user_thd) == LOCAL_STATE &&
wsrep_on(user_thd) &&
- !wsrep_thd_skip_append_keys(user_thd))
+ !wsrep_thd_ignore_table(user_thd))
{
DBUG_PRINT("wsrep", ("update row key"));
@@ -8891,7 +8891,7 @@ ha_innobase::delete_row(
if (error == DB_SUCCESS &&
wsrep_thd_exec_mode(user_thd) == LOCAL_STATE &&
wsrep_on(user_thd) &&
- !wsrep_thd_skip_append_keys(user_thd))
+ !wsrep_thd_ignore_table(user_thd))
{
if (wsrep_append_keys(user_thd, false, record, NULL)) {
DBUG_PRINT("wsrep", ("delete fail"));
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index e5edf764646..f459f41fbc7 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -8649,7 +8649,7 @@ report_error:
wsrep_thd_exec_mode(user_thd) == LOCAL_STATE &&
wsrep_on(user_thd) &&
!wsrep_consistency_check(user_thd) &&
- !wsrep_thd_skip_append_keys(user_thd))
+ !wsrep_thd_ignore_table(user_thd))
{
if (wsrep_append_keys(user_thd, false, record, NULL))
{
@@ -9195,7 +9195,7 @@ func_exit:
if (error == DB_SUCCESS &&
wsrep_thd_exec_mode(user_thd) == LOCAL_STATE &&
wsrep_on(user_thd) &&
- !wsrep_thd_skip_append_keys(user_thd))
+ !wsrep_thd_ignore_table(user_thd))
{
DBUG_PRINT("wsrep", ("update row key"));
@@ -9281,7 +9281,7 @@ ha_innobase::delete_row(
if (error == DB_SUCCESS &&
wsrep_thd_exec_mode(user_thd) == LOCAL_STATE &&
wsrep_on(user_thd) &&
- !wsrep_thd_skip_append_keys(user_thd))
+ !wsrep_thd_ignore_table(user_thd))
{
if (wsrep_append_keys(user_thd, false, record, NULL)) {
DBUG_PRINT("wsrep", ("delete fail"));