From 620358badd5627d2b47605e4515f65014e33204e Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Wed, 15 Jan 2020 19:03:39 +0800 Subject: [PATCH] Add some assert for debug --- src/system/detail/src/vnodeCache.c | 1 + src/system/detail/src/vnodeMeter.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/system/detail/src/vnodeCache.c b/src/system/detail/src/vnodeCache.c index 36bf872109..182717c1ab 100644 --- a/src/system/detail/src/vnodeCache.c +++ b/src/system/detail/src/vnodeCache.c @@ -966,6 +966,7 @@ void vnodeSetCommitQuery(SMeterObj *pObj, SQuery *pQuery) { pObj->vnode, pObj->sid, pObj->meterId, firstKey, pQuery->skey); pthread_mutex_lock(&(pVnode->vmutex)); if (firstKey < pVnode->firstKey) pVnode->firstKey = firstKey; + assert(pVnode->firstKey > 0); pthread_mutex_unlock(&(pVnode->vmutex)); } } diff --git a/src/system/detail/src/vnodeMeter.c b/src/system/detail/src/vnodeMeter.c index 06d0fd8b68..1c91b53428 100644 --- a/src/system/detail/src/vnodeMeter.c +++ b/src/system/detail/src/vnodeMeter.c @@ -655,6 +655,7 @@ int vnodeInsertPoints(SMeterObj *pObj, char *cont, int contLen, char source, voi if (pObj->lastKey > pVnode->lastKey) pVnode->lastKey = pObj->lastKey; if (firstKey < pVnode->firstKey) pVnode->firstKey = firstKey; + assert(pVnode->firstKey > 0); pVnode->version++; -- GitLab