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

Commit c416fb5

Browse files
committed
mention node number in 'aborted by DTM' error message
1 parent 3552597 commit c416fb5

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

arbiter.c

+1
Original file line numberDiff line numberDiff line change
@@ -1077,6 +1077,7 @@ static void MtmReceiver(Datum arg)
10771077
if (ts->status != TRANSACTION_STATUS_ABORTED) {
10781078
MTM_LOG1("Arbiter receive abort message for transaction %s (%llu) from node %d", ts->gid, (long64)ts->xid, node);
10791079
Assert(ts->status == TRANSACTION_STATUS_IN_PROGRESS);
1080+
ts->aborted_by_node = node;
10801081
MtmAbortTransaction(ts);
10811082
}
10821083
if ((ts->participantsMask & ~Mtm->disabledNodeMask & ~ts->votedMask) == 0) {

multimaster.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -4764,8 +4764,12 @@ static bool MtmTwoPhaseCommit(MtmCurrentTrans* x)
47644764
} else {
47654765
Assert(x->isActive);
47664766
if (x->status == TRANSACTION_STATUS_ABORTED) {
4767+
MtmTransState* ts;
4768+
ts = (MtmTransState*) hash_search(MtmXid2State, &(x->xid), HASH_FIND, NULL);
4769+
Assert(ts);
4770+
47674771
FinishPreparedTransaction(x->gid, false);
4768-
MTM_ELOG(ERROR, "Transaction %s (%llu) is aborted on neighbour node. Check neighbour nodes log to see error details.", x->gid, (long64)x->xid);
4772+
MTM_ELOG(ERROR, "Transaction %s (%llu) is aborted on node %d. Check its log to see error details.", x->gid, (long64)x->xid, ts->aborted_by_node);
47694773
} else {
47704774
FinishPreparedTransaction(x->gid, true);
47714775
MTM_LOG2("Distributed transaction %s (%lld) is committed at %lld with LSN=%lld", x->gid, (long64)x->xid, MtmGetCurrentTime(), (long64)GetXLogInsertRecPtr());

multimaster.h

+1
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ typedef struct MtmTransState
267267
nodemask_t participantsMask; /* Mask of nodes involved in transaction */
268268
nodemask_t votedMask; /* Mask of voted nodes */
269269
TransactionId xids[1]; /* [Mtm->nAllNodes]: transaction ID at replicas */
270+
int aborted_by_node; /* Store info about node on which this tx was aborted */
270271
} MtmTransState;
271272

272273
typedef struct {

0 commit comments

Comments
 (0)