diff options
author | Nirbhay Choubey <nirbhay@mariadb.com> | 2016-02-24 23:32:37 -0500 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2016-02-24 23:32:37 -0500 |
commit | 0251232f8c3bca33b4dd15d6668105f3de9d024d (patch) | |
tree | 35e47f8d51eaf2dcc4caab4b69749bae5a9f2de7 /sql | |
parent | b05158cc10a75196b5c0bf8dad9360608a2dd5b9 (diff) | |
download | mariadb-git-0251232f8c3bca33b4dd15d6668105f3de9d024d.tar.gz |
Fix to ensure updates in gtid_slave_state table do not get binlogged.
Also, renamed wsrep_skip_append_keys to wsrep_ignore_table.
Test case : galera.galera_as_slave_gtid.test
Diffstat (limited to 'sql')
-rw-r--r-- | sql/handler.cc | 12 | ||||
-rw-r--r-- | sql/rpl_gtid.cc | 4 | ||||
-rw-r--r-- | sql/sql_class.cc | 2 | ||||
-rw-r--r-- | sql/sql_class.h | 7 | ||||
-rw-r--r-- | sql/sql_plugin_services.ic | 2 | ||||
-rw-r--r-- | sql/wsrep_dummy.cc | 2 | ||||
-rw-r--r-- | sql/wsrep_mysqld.cc | 4 |
7 files changed, 22 insertions, 11 deletions
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; } |