From d82d51cf8f646892a2760da8c2353a611e43dd48 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Fri, 3 Nov 2023 10:40:00 +0800 Subject: [PATCH] Merge branch 'enh/new3.0' into enh/refactorBackend --- source/libs/stream/src/streamBackendRocksdb.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/source/libs/stream/src/streamBackendRocksdb.c b/source/libs/stream/src/streamBackendRocksdb.c index 589627c41a..664802bd8a 100644 --- a/source/libs/stream/src/streamBackendRocksdb.c +++ b/source/libs/stream/src/streamBackendRocksdb.c @@ -258,9 +258,6 @@ int32_t dbChkpGetDelta(SDbChkp* p, int64_t chkpId, SArray *list) { } } if (p->init == 0) { - p->preCkptId = -1; - p->curChkpId = chkpId; - p->init = 1; void* pIter = taosHashIterate(p->pSstTbl[1 - p->idx], NULL); while (pIter) { @@ -272,6 +269,10 @@ int32_t dbChkpGetDelta(SDbChkp* p, int64_t chkpId, SArray *list) { pIter = taosHashIterate(p->pSstTbl[1 - p->idx], pIter); } if (taosArrayGetSize(p->pAdd) > 0) p->update = 1; + + p->init = 1; + p->preCkptId = -1; + p->curChkpId = chkpId; } else { int32_t code = compareHashTable(p->pSstTbl[p->idx], p->pSstTbl[1 - p->idx], p->pAdd, p->pDel); if (code != 0) { @@ -284,12 +285,15 @@ int32_t dbChkpGetDelta(SDbChkp* p, int64_t chkpId, SArray *list) { return code; } - p->preCkptId = p->curChkpId; - p->curChkpId = chkpId; if (taosArrayGetSize(p->pAdd) == 0 && taosArrayGetSize(p->pDel) == 0) { p->update = 0; } + + p->preCkptId = p->curChkpId; + p->curChkpId = chkpId; } + + taosHashClear(p->pSstTbl[p->idx]); p->idx = 1 - p->idx;