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() );
ret = wsrep->desync(wsrep); if (!wsrep_desync)
if (ret != WSREP_OK)
{ {
WSREP_WARN("RSU desync failed %d for schema: %s, query: %s", ret = wsrep->desync(wsrep);
ret, if (ret != WSREP_OK)
(thd->db ? thd->db : "(null)"), {
thd->query()); WSREP_WARN("RSU desync failed %d for schema: %s, query: %s",
my_error(ER_LOCK_DEADLOCK, MYF(0)); ret, (thd->db ? thd->db : "(null)"), thd->query());
return(ret); my_error(ER_LOCK_DEADLOCK, MYF(0));
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);
ret = wsrep->resync(wsrep); if (!wsrep_desync)
if (ret != WSREP_OK)
{ {
WSREP_WARN("resync failed %d for schema: %s, query: %s", ret = wsrep->resync(wsrep);
ret, if (ret != WSREP_OK)
(thd->db ? thd->db : "(null)"), {
thd->query()); 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)); 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());
} }
ret = wsrep->resync(wsrep); if (!wsrep_desync)
if (ret != WSREP_OK)
{ {
WSREP_WARN("resync failed %d for schema: %s, query: %s", ret, ret = wsrep->resync(wsrep);
(thd->db ? thd->db : "(null)"), if (ret != WSREP_OK)
thd->query()); {
return; 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; 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