Skip to content

Commit 0a5d843

Browse files
committed
mention node number in 'aborted by DTM' error message
1 parent 8b8666e commit 0a5d843

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

contrib/mmts/arbiter.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,6 +1075,7 @@ static void MtmReceiver(Datum arg)
10751075
if (ts->status != TRANSACTION_STATUS_ABORTED) {
10761076
MTM_LOG1("Arbiter receive abort message for transaction %s (%llu) from node %d", ts->gid, (long64)ts->xid, node);
10771077
Assert(ts->status == TRANSACTION_STATUS_IN_PROGRESS);
1078+
ts->aborted_by_node = node;
10781079
MtmAbortTransaction(ts);
10791080
}
10801081
if ((ts->participantsMask & ~Mtm->disabledNodeMask & ~ts->votedMask) == 0) {

contrib/mmts/multimaster.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4750,8 +4750,12 @@ static bool MtmTwoPhaseCommit(MtmCurrentTrans* x)
47504750
} else {
47514751
Assert(x->isActive);
47524752
if (x->status == TRANSACTION_STATUS_ABORTED) {
4753+
MtmTransState* ts;
4754+
ts = (MtmTransState*) hash_search(MtmXid2State, &(x->xid), HASH_FIND, NULL);
4755+
Assert(ts);
4756+
47534757
FinishPreparedTransaction(x->gid, false);
4754-
MTM_ELOG(ERROR, "Transaction %s (%llu) is aborted on neighbour node. Check neighbour nodes log to see error details.", x->gid, (long64)x->xid);
4758+
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);
47554759
} else {
47564760
FinishPreparedTransaction(x->gid, true);
47574761
MTM_LOG2("Distributed transaction %s (%lld) is committed at %lld with LSN=%lld", x->gid, (long64)x->xid, MtmGetCurrentTime(), (long64)GetXLogInsertRecPtr());

contrib/mmts/multimaster.h

Lines changed: 1 addition & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy