diff --git a/source/dnode/vnode/src/vnd/vnodeSync.c b/source/dnode/vnode/src/vnd/vnodeSync.c index 1863203f4ad357a1d69723fbcd5169ed876a719f..56f533bf341b9c65949b9d8cba7c6738f43f7a88 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/util/src/tqueue.c b/source/util/src/tqueue.c index 8748f8df3f1e1a216587f159561bace3181d6128..f1f926c0b78a991710654f2536211f8d1ec4a76a 100644 --- a/source/util/src/tqueue.c +++ b/source/util/src/tqueue.c @@ -141,14 +141,10 @@ int32_t taosQueueItemSize(STaosQueue *queue) { } int64_t taosQueueMemorySize(STaosQueue *queue) { -#if 1 - return queue->memOfItems; -#else taosThreadMutexLock(&queue->mutex); int64_t memOfItems = queue->memOfItems; taosThreadMutexUnlock(&queue->mutex); return memOfItems; -#endif } void *taosAllocateQitem(int32_t size, EQItype itype) {