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

Commit 185bd09

Browse files
Alexander Kuzmenkovkelvich
Alexander Kuzmenkov
authored andcommitted
Fix warnings with DEBUG_LEVEL 2.
1 parent 58ccadd commit 185bd09

File tree

1 file changed

+23
-14
lines changed

1 file changed

+23
-14
lines changed

multimaster.c

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ MtmBeginTransaction(MtmCurrentTrans* x)
10251025

10261026
MtmUnlock();
10271027

1028-
MTM_LOG3("%d: MtmLocalTransaction: %s transaction %u uses local snapshot %llu",
1028+
MTM_LOG3("%d: MtmLocalTransaction: %s transaction "XID_FMT" uses local snapshot %llu",
10291029
MyProcPid, x->isDistributed ? "distributed" : "local", x->xid, x->snapshot);
10301030
} else {
10311031
Assert(MtmInsideTransaction);
@@ -1166,8 +1166,9 @@ MtmPrePrepareTransaction(MtmCurrentTrans* x)
11661166

11671167
MtmTransactionListAppend(ts);
11681168
MtmAddSubtransactions(ts, subxids, ts->nSubxids);
1169-
MTM_LOG3("%d: MtmPrePrepareTransaction prepare commit of %d (gtid.xid=%d, gtid.node=%d, CSN=%lld)",
1170-
MyProcPid, x->xid, ts->gtid.xid, ts->gtid.node, ts->csn);
1169+
MTM_LOG3("%d: MtmPrePrepareTransaction prepare commit of "
1170+
XID_FMT" (gtid.xid="XID_FMT", gtid.node=%d, CSN=%lld)",
1171+
MyProcPid, x->xid, ts->gtid.xid, ts->gtid.node, ts->csn);
11711172
MtmUnlock();
11721173
MTM_TXTRACE(x, "PrePrepareTransaction Finish");
11731174
}
@@ -1363,7 +1364,7 @@ Mtm2PCVoting(MtmCurrentTrans* x, MtmTransState* ts)
13631364
}
13641365
}
13651366
x->status = ts->status;
1366-
MTM_LOG3("%d: Result of vote: %d", MyProcPid, MtmTxnStatusMnem[ts->status]);
1367+
MTM_LOG3("%d: Result of vote: %s", MyProcPid, MtmTxnStatusMnem[ts->status]);
13671368
}
13681369

13691370
static void MtmStopTransaction(void)
@@ -1394,7 +1395,7 @@ MtmPostPrepareTransaction(MtmCurrentTrans* x)
13941395
ts = (MtmTransState*)hash_search(MtmXid2State, &x->xid, HASH_FIND, NULL);
13951396
Assert(ts != NULL);
13961397
if (!MtmIsCoordinator(ts) || Mtm->status == MTM_RECOVERY) {
1397-
MTM_LOG3("Preparing transaction %d (%s) at %lld", x->xid, x->gid, MtmGetCurrentTime());
1398+
MTM_LOG3("Preparing transaction "XID_FMT" (%s) at %lld", x->xid, x->gid, MtmGetCurrentTime());
13981399
Assert(x->gid[0]);
13991400
ts->votingCompleted = true;
14001401
if (Mtm->status != MTM_RECOVERY/* || Mtm->recoverySlot != MtmReplicationNodeId*/) {
@@ -1487,7 +1488,7 @@ MtmPreCommitPreparedTransaction(MtmCurrentTrans* x)
14871488
// return;
14881489
// }
14891490

1490-
MTM_LOG3("Commit prepared transaction %d with gid='%s'", x->xid, x->gid);
1491+
MTM_LOG3("Commit prepared transaction "XID_FMT" with gid='%s'", x->xid, x->gid);
14911492
ts = tm->state;
14921493

14931494
Assert(MtmIsCoordinator(ts));
@@ -1608,7 +1609,8 @@ MtmEndTransaction(MtmCurrentTrans* x, bool commit)
16081609
}
16091610
if (ts != NULL) {
16101611
if (*ts->gid)
1611-
MTM_LOG2("TRANSLOG: %s transaction gid=%s xid=%d node=%d dxid=%d status %s",
1612+
MTM_LOG2("TRANSLOG: %s transaction gid=%s xid="XID_FMT
1613+
" node=%d dxid="XID_FMT" status %s",
16121614
(commit ? "commit" : "rollback"), ts->gid, ts->xid, ts->gtid.node, ts->gtid.xid, MtmTxnStatusMnem[ts->status]);
16131615
if (commit) {
16141616
if (!(ts->status == TRANSACTION_STATUS_UNKNOWN
@@ -1901,7 +1903,7 @@ void MtmJoinTransaction(GlobalTransactionId* gtid, csn_t globalSnapshot, nodemas
19011903

19021904
void MtmSetCurrentTransactionGID(char const* gid)
19031905
{
1904-
MTM_LOG3("Set current transaction xid=%d GID %s", MtmTx.xid, gid);
1906+
MTM_LOG3("Set current transaction xid="XID_FMT" GID %s", MtmTx.xid, gid);
19051907
strcpy(MtmTx.gid, gid);
19061908
MtmTx.isDistributed = true;
19071909
MtmTx.isReplicated = true;
@@ -2133,8 +2135,8 @@ MtmPollStatusOfPreparedTransactions(bool majorMode)
21332135
}
21342136
}
21352137
} else {
2136-
MTM_LOG2("Skip prepared transaction %s (%d) with status %s gtid.node=%d gtid.xid=%llu votedMask=%llx",
2137-
ts->gid, (long64)ts->xid, MtmTxnStatusMnem[ts->status], ts->gtid.node, (long64)ts->gtid.xid, ts->votedMask);
2138+
MTM_LOG2("Skip prepared transaction %s ("XID_FMT") with status %s gtid.node=%d gtid.xid=%llu votedMask=%llx",
2139+
ts->gid, ts->xid, MtmTxnStatusMnem[ts->status], ts->gtid.node, (long64)ts->gtid.xid, ts->votedMask);
21382140
}
21392141
}
21402142
}
@@ -2236,8 +2238,11 @@ void MtmCheckRecoveryCaughtUp(int nodeId, lsn_t slotLSN)
22362238
BIT_SET(Mtm->originLockNodeMask, nodeId-1); // XXXX: log that
22372239
} else {
22382240
MTM_LOG2("Continue recovery of node %d, slot position %llx, WAL position %llx,"
2239-
" WAL sender position %llx, lockers %llx, active transactions %d", nodeId, slotLSN,
2240-
walLSN, MyWalSnd->sentPtr, Mtm->orinLockNodeMask, Mtm->nActiveTransactions);
2241+
" WAL sender position %llx, lockers %llx, active transactions %d",
2242+
nodeId, (long long unsigned int) slotLSN,
2243+
(long long unsigned int) walLSN,
2244+
(long long unsigned int) MyWalSnd->sentPtr,
2245+
Mtm->originLockNodeMask, Mtm->nActiveTransactions);
22412246
}
22422247
}
22432248
MtmUnlock();
@@ -3999,7 +4004,9 @@ void MtmBeginSession(int nodeId)
39994004
void MtmEndSession(int nodeId, bool unlock)
40004005
{
40014006
if (replorigin_session_origin != InvalidRepOriginId) {
4002-
MTM_LOG2("%d: Begin reset replorigin session for node %d: %d, progress %llx", MyProcPid, nodeId, replorigin_session_origin, replorigin_session_get_progress(false));
4007+
MTM_LOG2("%d: Begin reset replorigin session for node %d: %d, progress %llx",
4008+
MyProcPid, nodeId, replorigin_session_origin,
4009+
(long long unsigned int) replorigin_session_get_progress(false));
40034010
replorigin_session_origin = InvalidRepOriginId;
40044011
replorigin_session_origin_lsn = INVALID_LSN;
40054012
replorigin_session_origin_timestamp = 0;
@@ -5676,7 +5683,9 @@ MtmSerializeLock(PROCLOCK* proclock, void* arg)
56765683
{
56775684
if ((proclock->holdMask & LOCKBIT_ON(lm)) && (conflictMask & LOCKBIT_ON(lm)))
56785685
{
5679-
MTM_LOG3("%d: %u(%u) waits for %u(%u)", MyProcPid, srcPgXact->xid, proc->pid, dstPgXact->xid, proclock->tag.myProc->pid);
5686+
MTM_LOG3("%d: "XID_FMT"(%u) waits for "XID_FMT"(%u)",
5687+
MyProcPid, srcPgXact->xid, proc->pid,
5688+
dstPgXact->xid, proclock->tag.myProc->pid);
56805689
MtmGetGtid(dstPgXact->xid, &gtid); /* transaction holding lock */
56815690
ByteBufferAppend(buf, &gtid, sizeof(gtid));
56825691
break;

0 commit comments

Comments
 (0)