Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 234c13a

Browse files
committed
serch tx with GetLoggedPreparedXactState() upon MSG_POLL_REQUEST
1 parent 9186693 commit 234c13a

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

arbiter.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -966,10 +966,21 @@ static void MtmReceiver(Datum arg)
966966
case MSG_POLL_REQUEST:
967967
Assert(*msg->gid);
968968
tm = (MtmTransMap*)hash_search(MtmGid2State, msg->gid, HASH_FIND, NULL);
969-
if (tm == NULL || tm->state == NULL) {
970-
MTM_ELOG(WARNING, "Request for unexisted transaction %s from node %d", msg->gid, node);
971-
msg->status = TRANSACTION_STATUS_ABORTED;
972-
} else {
969+
if (tm == NULL || tm->state == NULL)
970+
{
971+
XidStatus status = GetLoggedPreparedXactState(msg->gid);
972+
if (status == TRANSACTION_STATUS_UNKNOWN)
973+
{
974+
MTM_ELOG(WARNING, "Request for unexisted transaction %s from node %d", msg->gid, node);
975+
}
976+
else
977+
{
978+
MTM_LOG1("Request for existed transaction %s from node %d -> %d", msg->gid, node, status);
979+
msg->status = status;
980+
}
981+
}
982+
else
983+
{
973984
msg->status = tm->state->status;
974985
msg->csn = tm->state->csn;
975986
MTM_LOG1("Send response %s for transaction %s to node %d", MtmTxnStatusMnem[msg->status], msg->gid, node);

0 commit comments

Comments
 (0)