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

Commit e8bdcc6

Browse files
committed
change some debug messages
1 parent 563d921 commit e8bdcc6

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

contrib/mmts/arbiter.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ static void MtmSendHeartbeat()
361361
if (!MtmSendToNode(i, &msg, sizeof(msg))) {
362362
elog(LOG, "Arbiter failed to send heartbeat to node %d", i+1);
363363
} else {
364-
MTM_LOG2("Send heartbeat to node %d with timestamp %ld", i+1, now);
364+
MTM_LOG4("Send heartbeat to node %d with timestamp %ld", i+1, now);
365365
}
366366
} else {
367367
MTM_LOG2("Do not send heartbeat to node %d, busy mask %lld, status %d", i+1, (long long) busy_mask, Mtm->status);
@@ -887,7 +887,7 @@ static void MtmReceiver(Datum arg)
887887

888888
switch (msg->code) {
889889
case MSG_HEARTBEAT:
890-
MTM_LOG2("Receive HEARTBEAT from node %d with timestamp %ld delay %ld",
890+
MTM_LOG4("Receive HEARTBEAT from node %d with timestamp %ld delay %ld",
891891
node, msg->csn, USEC_TO_MSEC(MtmGetSystemTime() - msg->csn));
892892
continue;
893893
case MSG_POLL_REQUEST:

contrib/mmts/multimaster.c

+11-1
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,7 @@ MtmPostPrepareTransaction(MtmCurrentTrans* x)
10281028
MTM_TXTRACE(x, "PostPrepareTransaction Start");
10291029

10301030
if (!x->isDistributed) {
1031+
MTM_TXTRACE(x, "not distributed?");
10311032
return;
10321033
}
10331034

@@ -1040,25 +1041,34 @@ MtmPostPrepareTransaction(MtmCurrentTrans* x)
10401041
Assert(ts != NULL);
10411042
//if (x->gid[0]) MTM_LOG1("Preparing transaction %d (%s) at %ld", x->xid, x->gid, MtmGetCurrentTime());
10421043
if (!MtmIsCoordinator(ts) || Mtm->status == MTM_RECOVERY) {
1044+
MTM_TXTRACE(x, "recovery?");
10431045
Assert(x->gid[0]);
10441046
ts->votingCompleted = true;
1045-
if (Mtm->status != MTM_RECOVERY || Mtm->recoverySlot != MtmReplicationNodeId) {
1047+
MTM_TXTRACE(x, "recovery? 1");
1048+
if (Mtm->status != MTM_RECOVERY || Mtm->recoverySlot != MtmReplicationNodeId) {
1049+
MTM_TXTRACE(x, "recovery? 2");
10461050
MtmSend2PCMessage(ts, MSG_PREPARED); /* send notification to coordinator */
10471051
if (!MtmUseDtm) {
10481052
ts->status = TRANSACTION_STATUS_UNKNOWN;
10491053
}
10501054
} else {
1055+
MTM_TXTRACE(x, "recovery? 3");
10511056
ts->status = TRANSACTION_STATUS_UNKNOWN;
10521057
}
1058+
MTM_TXTRACE(x, "recovery? 4");
10531059
MtmUnlock();
1060+
MTM_TXTRACE(x, "recovery? 5");
10541061
MtmResetTransaction();
1062+
MTM_TXTRACE(x, "recovery? 6");
10551063
} else {
1064+
MTM_TXTRACE(x, "not recovery?");
10561065
Mtm2PCVoting(x, ts);
10571066
MtmUnlock();
10581067
if (x->isTwoPhase) {
10591068
MtmResetTransaction();
10601069
}
10611070
}
1071+
MTM_TXTRACE(x, "recovery? 7");
10621072
//if (x->gid[0]) MTM_LOG1("Prepared transaction %d (%s) csn=%ld at %ld: %d", x->xid, x->gid, ts->csn, MtmGetCurrentTime(), ts->status);
10631073
if (Mtm->inject2PCError == 3) {
10641074
Mtm->inject2PCError = 0;

0 commit comments

Comments
 (0)