Commit 8ec50ebd authored by sjaakola's avatar sjaakola Committed by Nirbhay Choubey

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
parent b159b666
......@@ -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);
......
......@@ -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;
......
......@@ -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 */
};
......
......@@ -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;
}
......@@ -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 */
......@@ -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();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment