Commit 4bdf0258 authored by sjaakola's avatar sjaakola Committed by Nirbhay Choubey

refs MW-246

- skipping desync and resync before and after DDL execution in RSU mode, if wsrep_desync is set upfront
parent 89a26480
......@@ -1303,16 +1303,19 @@ static int wsrep_RSU_begin(THD *thd, char *db_, char *table_)
WSREP_DEBUG("RSU BEGIN: %lld, %d : %s", (long long)wsrep_thd_trx_seqno(thd),
thd->wsrep_exec_mode, thd->query() );
ret = wsrep->desync(wsrep);
if (ret != WSREP_OK)
if (!wsrep_desync)
{
WSREP_WARN("RSU desync failed %d for schema: %s, query: %s",
ret,
(thd->db ? thd->db : "(null)"),
thd->query());
my_error(ER_LOCK_DEADLOCK, MYF(0));
return(ret);
ret = wsrep->desync(wsrep);
if (ret != WSREP_OK)
{
WSREP_WARN("RSU desync failed %d for schema: %s, query: %s",
ret, (thd->db ? thd->db : "(null)"), thd->query());
my_error(ER_LOCK_DEADLOCK, MYF(0));
return(ret);
}
}
else
WSREP_DEBUG("RSU desync skipped: %d", wsrep_desync);
mysql_mutex_lock(&LOCK_wsrep_replaying);
wsrep_replaying++;
mysql_mutex_unlock(&LOCK_wsrep_replaying);
......@@ -1327,13 +1330,14 @@ static int wsrep_RSU_begin(THD *thd, char *db_, char *table_)
wsrep_replaying--;
mysql_mutex_unlock(&LOCK_wsrep_replaying);
ret = wsrep->resync(wsrep);
if (ret != WSREP_OK)
if (!wsrep_desync)
{
WSREP_WARN("resync failed %d for schema: %s, query: %s",
ret,
(thd->db ? thd->db : "(null)"),
thd->query());
ret = wsrep->resync(wsrep);
if (ret != WSREP_OK)
{
WSREP_WARN("resync failed %d for schema: %s, query: %s",
ret, (thd->db ? thd->db : "(null)"), thd->query());
}
}
my_error(ER_LOCK_DEADLOCK, MYF(0));
return(1);
......@@ -1370,14 +1374,18 @@ static void wsrep_RSU_end(THD *thd)
(thd->db ? thd->db : "(null)"),
thd->query());
}
ret = wsrep->resync(wsrep);
if (ret != WSREP_OK)
if (!wsrep_desync)
{
WSREP_WARN("resync failed %d for schema: %s, query: %s", ret,
(thd->db ? thd->db : "(null)"),
thd->query());
return;
ret = wsrep->resync(wsrep);
if (ret != WSREP_OK)
{
WSREP_WARN("resync failed %d for schema: %s, query: %s", ret,
(thd->db ? thd->db : "(null)"), thd->query());
return;
}
}
else
WSREP_DEBUG("RSU resync skipped: %d", wsrep_desync);
thd->variables.wsrep_on = 1;
}
......
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