summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-12-22 10:32:33 +0100
committerSergei Golubchik <serg@mariadb.org>2015-12-22 10:32:33 +0100
commit7697bf0bd7e5b50c1071742ac90539be71f6eabe (patch)
tree9c4f650d6961467da0bbda23e3697571c984832d /sql
parent0686c34d22a5cbf93015012eaf77a4a977b63afb (diff)
parent080da551ea171f8a43633ab27b56875938643dd0 (diff)
downloadmariadb-git-7697bf0bd7e5b50c1071742ac90539be71f6eabe.tar.gz
Merge branch 'github/10.0-galera' into 10.1
Note: some tests fail, just as they failed before the merge!
Diffstat (limited to 'sql')
-rw-r--r--sql/mysqld.cc10
-rw-r--r--sql/rpl_gtid.cc12
-rw-r--r--sql/sql_class.cc3
-rw-r--r--sql/sql_class.h1
-rw-r--r--sql/sql_plugin_services.ic1
-rw-r--r--sql/wsrep_dummy.cc3
-rw-r--r--sql/wsrep_mysqld.cc8
-rw-r--r--sql/wsrep_mysqld.h2
8 files changed, 36 insertions, 4 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 566d0ff9e04..121d3432758 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -5230,10 +5230,20 @@ static int init_server_components()
THD *current_thd_saved= current_thd;
set_current_thd(tmp);
+ /*
+ Also save/restore server_status and variables.option_bits and they
+ get altered during init_for_queries().
+ */
+ unsigned int server_status_saved= tmp->server_status;
+ ulonglong option_bits_saved= tmp->variables.option_bits;
+
tmp->init_for_queries();
/* Restore current_thd. */
set_current_thd(current_thd_saved);
+
+ tmp->server_status= server_status_saved;
+ tmp->variables.option_bits= option_bits_saved;
}
}
mysql_mutex_unlock(&LOCK_thread_count);
diff --git a/sql/rpl_gtid.cc b/sql/rpl_gtid.cc
index 90d750c38ad..47c0f4e3fb7 100644
--- a/sql/rpl_gtid.cc
+++ b/sql/rpl_gtid.cc
@@ -562,6 +562,14 @@ rpl_slave_state::record_gtid(THD *thd, const rpl_gtid *gtid, uint64 sub_id,
if ((err= gtid_check_rpl_slave_state_table(table)))
goto end;
+#ifdef WITH_WSREP
+ /*
+ Updates in slave state table should not be appended to galera transaction
+ writeset.
+ */
+ thd->wsrep_skip_append_keys= true;
+#endif
+
if (!in_transaction)
{
DBUG_PRINT("info", ("resetting OPTION_BEGIN"));
@@ -676,6 +684,10 @@ IF_DBUG(dbug_break:, )
end:
+#ifdef WITH_WSREP
+ thd->wsrep_skip_append_keys= false;
+#endif
+
if (table_opened)
{
if (err || (err= ha_commit_trans(thd, FALSE)))
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index e95e32a5e0b..729b23cf993 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -901,7 +901,8 @@ THD::THD(bool is_wsrep_applier)
wsrep_apply_toi(false),
wsrep_po_handle(WSREP_PO_INITIALIZER),
wsrep_po_cnt(0),
- wsrep_apply_format(0)
+ wsrep_apply_format(0),
+ wsrep_skip_append_keys(false)
#endif
{
ulong tmp;
diff --git a/sql/sql_class.h b/sql/sql_class.h
index aee6d560bfb..27837e4f60a 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -3989,6 +3989,7 @@ public:
#endif /* GTID_SUPPORT */
void *wsrep_apply_format;
char wsrep_info[128]; /* string for dynamic proc info */
+ bool wsrep_skip_append_keys;
#endif /* WITH_WSREP */
/* Handling of timeouts for commands */
diff --git a/sql/sql_plugin_services.ic b/sql/sql_plugin_services.ic
index 0570e2fcdd9..da0cc17250b 100644
--- a/sql/sql_plugin_services.ic
+++ b/sql/sql_plugin_services.ic
@@ -133,6 +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_trx_seqno,
wsrep_thd_ws_handle,
wsrep_trx_is_aborting,
diff --git a/sql/wsrep_dummy.cc b/sql/wsrep_dummy.cc
index 5cbf6821e7c..603cd8ec5ea 100644
--- a/sql/wsrep_dummy.cc
+++ b/sql/wsrep_dummy.cc
@@ -116,6 +116,9 @@ int wsrep_thd_retry_counter(THD *)
void wsrep_thd_set_conflict_state(THD *, enum wsrep_conflict_state)
{ }
+bool wsrep_thd_skip_append_keys(THD *)
+{ return 0; }
+
longlong wsrep_thd_trx_seqno(THD *)
{ return -1; }
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index 90b1c132ae9..b922d2b2857 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -1877,7 +1877,7 @@ error:
WSREP_ERROR("Failed to create/initialize system thread");
/* Abort if its the first applier/rollbacker thread. */
- if (wsrep_creating_startup_threads < 2)
+ if (wsrep_creating_startup_threads == 1)
unireg_abort(1);
else
return NULL;
@@ -2381,6 +2381,12 @@ int wsrep_thd_retry_counter(THD *thd)
}
+extern "C" bool wsrep_thd_skip_append_keys(THD *thd)
+{
+ return thd->wsrep_skip_append_keys;
+}
+
+
extern int
wsrep_trx_order_before(THD *thd1, THD *thd2)
{
diff --git a/sql/wsrep_mysqld.h b/sql/wsrep_mysqld.h
index 3c36e88eb6d..26d3484b3b4 100644
--- a/sql/wsrep_mysqld.h
+++ b/sql/wsrep_mysqld.h
@@ -151,7 +151,6 @@ extern "C" query_id_t wsrep_thd_query_id(THD *thd);
extern "C" query_id_t wsrep_thd_wsrep_last_query_id(THD *thd);
extern "C" void wsrep_thd_set_wsrep_last_query_id(THD *thd, query_id_t id);
-
extern void wsrep_close_client_connections(my_bool wait_to_end);
extern int wsrep_wait_committing_connections_close(int wait_time);
extern void wsrep_close_applier(THD *thd);
@@ -165,7 +164,6 @@ extern bool wsrep_start_replication();
extern bool wsrep_sync_wait(THD* thd, uint mask = WSREP_SYNC_WAIT_BEFORE_READ);
extern int wsrep_check_opts();
extern void wsrep_prepend_PATH (const char* path);
-/* some inline functions are defined in wsrep_mysqld_inl.h */
/* Other global variables */
extern wsrep_seqno_t wsrep_locked_seqno;