提交 922436e7 编写于 作者: S Shengliang Guan

fix: lock mem items of tqueue

上级 5ee04e80
......@@ -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 {
......
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册