Skip to content

Commit 8ec50eb

Browse files
sjaakolaNirbhay Choubey
authored andcommitted
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
1 parent b159b66 commit 8ec50eb

File tree

6 files changed

+10
-7
lines changed

6 files changed

+10
-7
lines changed

sql/lock.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ void Global_read_lock::unlock_global_read_lock(THD *thd)
10711071
#ifdef WITH_WSREP
10721072
wsrep_locked_seqno= WSREP_SEQNO_UNDEFINED;
10731073
wsrep->resume(wsrep);
1074-
if (!wsrep_desync && !thd->wsrep_donor)
1074+
if (!wsrep_desync && !wsrep_node_is_donor())
10751075
{
10761076
int ret = wsrep->resync(wsrep);
10771077
if (ret != WSREP_OK)
@@ -1141,13 +1141,13 @@ bool Global_read_lock::make_global_read_lock_block_commit(THD *thd)
11411141
Donor servicing thread is an exception, it should pause provider but not desync,
11421142
as it is already desynced in donor state
11431143
*/
1144-
if (!WSREP(thd) && !thd->wsrep_donor)
1144+
if (!WSREP(thd) && !wsrep_node_is_donor())
11451145
{
11461146
DBUG_RETURN(FALSE);
11471147
}
11481148

11491149
/* if already desynced or donor, avoid double desyncing */
1150-
if (wsrep_desync || thd->wsrep_donor)
1150+
if (wsrep_desync || wsrep_node_is_donor())
11511151
{
11521152
WSREP_DEBUG("desync set upfont, skipping implicit desync for FTWRL: %d",
11531153
wsrep_desync);

sql/sql_class.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,8 +1088,7 @@ THD::THD()
10881088
wsrep_po_in_trans(FALSE),
10891089
wsrep_apply_format(0),
10901090
wsrep_apply_toi(false),
1091-
wsrep_skip_append_keys(false),
1092-
wsrep_donor(false)
1091+
wsrep_skip_append_keys(false)
10931092
#endif
10941093
{
10951094
ulong tmp;

sql/sql_class.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3880,7 +3880,6 @@ class THD :public Statement,
38803880
bool wsrep_apply_toi; /* applier processing in TOI */
38813881
bool wsrep_skip_append_keys;
38823882
wsrep_gtid_t wsrep_sync_wait_gtid;
3883-
my_bool wsrep_donor; /* true if thread is SST donor servicing */
38843883
ulong wsrep_affected_rows;
38853884
#endif /* WITH_WSREP */
38863885
};

sql/wsrep_mysqld.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1587,3 +1587,8 @@ wsrep_grant_mdl_exception(MDL_context *requestor_ctx,
15871587
}
15881588
return ret;
15891589
}
1590+
1591+
bool wsrep_node_is_donor()
1592+
{
1593+
return (WSREP_ON) ? (local_status.get() == 2) : false;
1594+
}

sql/wsrep_mysqld.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,4 +330,5 @@ int wsrep_alter_event_query(THD *thd, uchar** buf, size_t* buf_len);
330330
void wsrep_init_sidno(const wsrep_uuid_t&);
331331
#endif /* GTID_SUPPORT */
332332

333+
bool wsrep_node_is_donor();
333334
#endif /* WSREP_MYSQLD_H */

sql/wsrep_sst.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,6 @@ static void* sst_donor_thread (void* a)
979979

980980
wsp::thd thd(FALSE); // we turn off wsrep_on for this THD so that it can
981981
// operate with wsrep_ready == OFF
982-
thd.ptr->wsrep_donor = true;
983982
wsp::process proc(arg->cmd, "r", arg->env);
984983

985984
err= proc.error();

0 commit comments

Comments
 (0)