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