summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsjaakola <seppo.jaakola@iki.fi>2016-02-29 22:54:58 +0200
committerNirbhay Choubey <nirbhay@mariadb.com>2016-08-21 16:17:02 -0400
commit8ec50ebda3c558e34f263c08b2661929f0bdad2d (patch)
tree9207a03c84494934f4d56a920d835627bdcf9913
parentb159b666e5191b22618e631e9ed48159be541f7e (diff)
downloadmariadb-git-8ec50ebda3c558e34f263c08b2661929f0bdad2d.tar.gz
Refs MW-252
- reverted from tracking donor servicing thread. With xtrabackup SST, xtrabackup thread will call FTWRL and node is desynced upfront - Skipping desync in FTWRL if node is operating as donor
-rw-r--r--sql/lock.cc6
-rw-r--r--sql/sql_class.cc3
-rw-r--r--sql/sql_class.h1
-rw-r--r--sql/wsrep_mysqld.cc5
-rw-r--r--sql/wsrep_mysqld.h1
-rw-r--r--sql/wsrep_sst.cc1
6 files changed, 10 insertions, 7 deletions
diff --git a/sql/lock.cc b/sql/lock.cc
index 04529308266..8c426deda17 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -1071,7 +1071,7 @@ void Global_read_lock::unlock_global_read_lock(THD *thd)
#ifdef WITH_WSREP
wsrep_locked_seqno= WSREP_SEQNO_UNDEFINED;
wsrep->resume(wsrep);
- if (!wsrep_desync && !thd->wsrep_donor)
+ if (!wsrep_desync && !wsrep_node_is_donor())
{
int ret = wsrep->resync(wsrep);
if (ret != WSREP_OK)
@@ -1141,13 +1141,13 @@ bool Global_read_lock::make_global_read_lock_block_commit(THD *thd)
Donor servicing thread is an exception, it should pause provider but not desync,
as it is already desynced in donor state
*/
- if (!WSREP(thd) && !thd->wsrep_donor)
+ if (!WSREP(thd) && !wsrep_node_is_donor())
{
DBUG_RETURN(FALSE);
}
/* if already desynced or donor, avoid double desyncing */
- if (wsrep_desync || thd->wsrep_donor)
+ if (wsrep_desync || wsrep_node_is_donor())
{
WSREP_DEBUG("desync set upfont, skipping implicit desync for FTWRL: %d",
wsrep_desync);
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 6495069971b..4873586aba5 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -1088,8 +1088,7 @@ THD::THD()
wsrep_po_in_trans(FALSE),
wsrep_apply_format(0),
wsrep_apply_toi(false),
- wsrep_skip_append_keys(false),
- wsrep_donor(false)
+ wsrep_skip_append_keys(false)
#endif
{
ulong tmp;
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 6181333e1b2..ee637b3726d 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -3880,7 +3880,6 @@ public:
bool wsrep_apply_toi; /* applier processing in TOI */
bool wsrep_skip_append_keys;
wsrep_gtid_t wsrep_sync_wait_gtid;
- my_bool wsrep_donor; /* true if thread is SST donor servicing */
ulong wsrep_affected_rows;
#endif /* WITH_WSREP */
};
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index 0dd5c4dba14..734406080e9 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -1587,3 +1587,8 @@ wsrep_grant_mdl_exception(MDL_context *requestor_ctx,
}
return ret;
}
+
+bool wsrep_node_is_donor()
+{
+ return (WSREP_ON) ? (local_status.get() == 2) : false;
+}
diff --git a/sql/wsrep_mysqld.h b/sql/wsrep_mysqld.h
index 242227fd2a0..514c1f32cff 100644
--- a/sql/wsrep_mysqld.h
+++ b/sql/wsrep_mysqld.h
@@ -330,4 +330,5 @@ int wsrep_alter_event_query(THD *thd, uchar** buf, size_t* buf_len);
void wsrep_init_sidno(const wsrep_uuid_t&);
#endif /* GTID_SUPPORT */
+bool wsrep_node_is_donor();
#endif /* WSREP_MYSQLD_H */
diff --git a/sql/wsrep_sst.cc b/sql/wsrep_sst.cc
index d13148b3d48..b697a557476 100644
--- a/sql/wsrep_sst.cc
+++ b/sql/wsrep_sst.cc
@@ -979,7 +979,6 @@ static void* sst_donor_thread (void* a)
wsp::thd thd(FALSE); // we turn off wsrep_on for this THD so that it can
// operate with wsrep_ready == OFF
- thd.ptr->wsrep_donor = true;
wsp::process proc(arg->cmd, "r", arg->env);
err= proc.error();