Commit d246630d authored by sjaakola's avatar sjaakola Committed by Nirbhay Choubey

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.
parent f3444c4a
......@@ -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);
......
......@@ -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;
}
......@@ -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 */
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