Refs MW-252

- changed the condition when to do implicit desync as part of FTWRL to
  cover only case when node is PC and synced. Donor node has alreaydy desycned
  and other states mean that node is not in cluster, so desync is not even possible.
This commit is contained in:
sjaakola 2016-03-07 23:34:03 +02:00 committed by Nirbhay Choubey
parent f3444c4a43
commit d246630d73
3 changed files with 11 additions and 3 deletions

View file

@ -1073,7 +1073,8 @@ void Global_read_lock::unlock_global_read_lock(THD *thd)
{
wsrep_locked_seqno= WSREP_SEQNO_UNDEFINED;
wsrep->resume(wsrep);
if (!wsrep_desync && !wsrep_node_is_donor())
/* resync here only if we did implicit desync earlier */
if (!wsrep_desync && wsrep_node_is_synced())
{
int ret = wsrep->resync(wsrep);
if (ret != WSREP_OK)
@ -1149,8 +1150,10 @@ bool Global_read_lock::make_global_read_lock_block_commit(THD *thd)
DBUG_RETURN(FALSE);
}
/* if already desynced or donor, avoid double desyncing */
if (wsrep_desync || wsrep_node_is_donor())
/* if already desynced or donor, avoid double desyncing
if not in PC and synced, desyncing is not possible either
*/
if (wsrep_desync || !wsrep_node_is_synced())
{
WSREP_DEBUG("desync set upfont, skipping implicit desync for FTWRL: %d",
wsrep_desync);

View file

@ -1592,3 +1592,7 @@ bool wsrep_node_is_donor()
{
return (WSREP_ON) ? (local_status.get() == 2) : false;
}
bool wsrep_node_is_synced()
{
return (WSREP_ON) ? (local_status.get() == 4) : false;
}

View file

@ -331,4 +331,5 @@ void wsrep_init_sidno(const wsrep_uuid_t&);
#endif /* GTID_SUPPORT */
bool wsrep_node_is_donor();
bool wsrep_node_is_synced();
#endif /* WSREP_MYSQLD_H */