1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

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
This commit is contained in:
sjaakola
2016-02-29 22:54:58 +02:00
committed by Nirbhay Choubey
parent b159b666e5
commit 8ec50ebda3
6 changed files with 10 additions and 7 deletions

View File

@ -1071,7 +1071,7 @@ void Global_read_lock::unlock_global_read_lock(THD *thd)
#ifdef WITH_WSREP #ifdef WITH_WSREP
wsrep_locked_seqno= WSREP_SEQNO_UNDEFINED; wsrep_locked_seqno= WSREP_SEQNO_UNDEFINED;
wsrep->resume(wsrep); wsrep->resume(wsrep);
if (!wsrep_desync && !thd->wsrep_donor) if (!wsrep_desync && !wsrep_node_is_donor())
{ {
int ret = wsrep->resync(wsrep); int ret = wsrep->resync(wsrep);
if (ret != WSREP_OK) 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, Donor servicing thread is an exception, it should pause provider but not desync,
as it is already desynced in donor state as it is already desynced in donor state
*/ */
if (!WSREP(thd) && !thd->wsrep_donor) if (!WSREP(thd) && !wsrep_node_is_donor())
{ {
DBUG_RETURN(FALSE); DBUG_RETURN(FALSE);
} }
/* if already desynced or donor, avoid double desyncing */ /* 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_DEBUG("desync set upfont, skipping implicit desync for FTWRL: %d",
wsrep_desync); wsrep_desync);

View File

@ -1088,8 +1088,7 @@ THD::THD()
wsrep_po_in_trans(FALSE), wsrep_po_in_trans(FALSE),
wsrep_apply_format(0), wsrep_apply_format(0),
wsrep_apply_toi(false), wsrep_apply_toi(false),
wsrep_skip_append_keys(false), wsrep_skip_append_keys(false)
wsrep_donor(false)
#endif #endif
{ {
ulong tmp; ulong tmp;

View File

@ -3880,7 +3880,6 @@ public:
bool wsrep_apply_toi; /* applier processing in TOI */ bool wsrep_apply_toi; /* applier processing in TOI */
bool wsrep_skip_append_keys; bool wsrep_skip_append_keys;
wsrep_gtid_t wsrep_sync_wait_gtid; wsrep_gtid_t wsrep_sync_wait_gtid;
my_bool wsrep_donor; /* true if thread is SST donor servicing */
ulong wsrep_affected_rows; ulong wsrep_affected_rows;
#endif /* WITH_WSREP */ #endif /* WITH_WSREP */
}; };

View File

@ -1587,3 +1587,8 @@ wsrep_grant_mdl_exception(MDL_context *requestor_ctx,
} }
return ret; return ret;
} }
bool wsrep_node_is_donor()
{
return (WSREP_ON) ? (local_status.get() == 2) : false;
}

View File

@ -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&); void wsrep_init_sidno(const wsrep_uuid_t&);
#endif /* GTID_SUPPORT */ #endif /* GTID_SUPPORT */
bool wsrep_node_is_donor();
#endif /* WSREP_MYSQLD_H */ #endif /* WSREP_MYSQLD_H */

View File

@ -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 wsp::thd thd(FALSE); // we turn off wsrep_on for this THD so that it can
// operate with wsrep_ready == OFF // operate with wsrep_ready == OFF
thd.ptr->wsrep_donor = true;
wsp::process proc(arg->cmd, "r", arg->env); wsp::process proc(arg->cmd, "r", arg->env);
err= proc.error(); err= proc.error();