From 71ac720ac06978eee2722e567cd6fb9461d23915 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Sat, 22 Oct 2022 08:47:09 +0800 Subject: [PATCH] fix: compile error in mac --- source/dnode/vnode/src/vnd/vnodeSync.c | 4 ++-- source/libs/sync/src/syncAppendEntries.c | 2 +- source/libs/sync/src/syncMain.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/dnode/vnode/src/vnd/vnodeSync.c b/source/dnode/vnode/src/vnd/vnodeSync.c index 56f533bf34..1863203f4a 100644 --- a/source/dnode/vnode/src/vnd/vnodeSync.c +++ b/source/dnode/vnode/src/vnd/vnodeSync.c @@ -519,7 +519,7 @@ static int32_t vnodeSnapshotStartWrite(struct SSyncFSM *pFsm, void *pParam, void do { int32_t itemSize = tmsgGetQueueSize(&pVnode->msgCb, pVnode->config.vgId, APPLY_QUEUE); - if (itemSize <= 0) { + if (itemSize == 0) { vInfo("vgId:%d, start write vnode snapshot since apply queue is empty", pVnode->config.vgId); break; } else { @@ -572,7 +572,7 @@ static void vnodeRestoreFinish(struct SSyncFSM *pFsm) { do { int32_t itemSize = tmsgGetQueueSize(&pVnode->msgCb, pVnode->config.vgId, APPLY_QUEUE); - if (itemSize <= 0) { + if (itemSize == 0) { vInfo("vgId:%d, apply queue is empty, restore finish", pVnode->config.vgId); break; } else { diff --git a/source/libs/sync/src/syncAppendEntries.c b/source/libs/sync/src/syncAppendEntries.c index 5ad36f7f97..170a57a7a9 100644 --- a/source/libs/sync/src/syncAppendEntries.c +++ b/source/libs/sync/src/syncAppendEntries.c @@ -185,7 +185,7 @@ static int32_t syncNodeDoMakeLogSame(SSyncNode* ths, SyncIndex FromIndex) { do { char logBuf[128]; - snprintf(logBuf, sizeof(logBuf), "make log same from:%l" PRId64 ", delbegin:%" PRId64 ", pass:%d", FromIndex, + snprintf(logBuf, sizeof(logBuf), "make log same from:%" PRId64 ", delbegin:%" PRId64 ", pass:%d", FromIndex, delBegin, pass); syncNodeEventLog(ths, logBuf); } while (0); diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index be6b0d4d0f..324ac85c1e 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -3150,7 +3150,7 @@ int32_t syncDoLeaderTransfer(SSyncNode* ths, SRpcMsg* pRpcMsg, SSyncRaftEntry* p if (pEntry->index < syncNodeGetLastIndex(ths)) { char logBuf[128]; - snprintf(logBuf, sizeof(logBuf), "little index:%" PRId64, can not do leader transfer", pEntry->index); + snprintf(logBuf, sizeof(logBuf), "little index:%" PRId64 ", can not do leader transfer", pEntry->index); syncNodeEventLog(ths, logBuf); return 0; } -- GitLab