Commit 6ae44283 authored by Phoebe Buckheister's avatar Phoebe Buckheister 🦎

meta: commit resync changes before sending responses

usually we may commit resync changes after the response was sent, but
this is *not* safe for messages that communicate with other servers
during processing (eg MkDir). in such a case a response may be sent for
the "inner" request to the "outer" request before the changeset is
applied, causing the "outer" request to unlock its state before it is
safe to do so.

(cherry picked from commit ab1b2a032350e525b88ee48501e05ea83de47225)
parent f1d9b009
......@@ -183,14 +183,6 @@ class MirroredMessage : public BaseT
// pairs with the memory barrier before acquireMirrorStateSlot
__sync_synchronize();
if (responsePtr && buddyCommSuccessful)
responsePtr->sendResponse(ctx);
else if (!buddyCommSuccessful)
ctx.sendResponse(
GenericResponseMsg(
GenericRespMsgCode_INDIRECTCOMMERR_NOTAGAIN,
"Communication with secondary failed"));
if (BuddyResyncer::getSyncChangeset())
{
if (isMirrored() &&
......@@ -202,6 +194,14 @@ class MirroredMessage : public BaseT
BuddyResyncer::abandonSyncChangeset();
}
if (responsePtr && buddyCommSuccessful)
responsePtr->sendResponse(ctx);
else if (!buddyCommSuccessful)
ctx.sendResponse(
GenericResponseMsg(
GenericRespMsgCode_INDIRECTCOMMERR_NOTAGAIN,
"Communication with secondary failed"));
lockState = {};
}
......
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