From acdcd47243de8d0e5ccde73fac3edb36f92e73db Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Sat, 15 Aug 2020 14:52:38 +0800 Subject: [PATCH] a crash generated by dn3_mn1_replica_change.sim --- src/tsdb/src/tsdbRead.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/tsdb/src/tsdbRead.c b/src/tsdb/src/tsdbRead.c index c89ae0698a..ac3a6dac07 100644 --- a/src/tsdb/src/tsdbRead.c +++ b/src/tsdb/src/tsdbRead.c @@ -1795,19 +1795,22 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) { if (pQueryHandle->checkFiles) { bool exists = true; + int32_t code = getDataBlocksInFiles(pQueryHandle, &exists); if (code != TSDB_CODE_SUCCESS) { - return code; + pQueryHandle->activeIndex = 0; + pQueryHandle->checkFiles = false; + + return false; } if (exists) { - elapsedTime = taosGetTimestampUs() - stime; - pQueryHandle->cost.checkForNextTime += elapsedTime; + pQueryHandle->cost.checkForNextTime += (taosGetTimestampUs() - stime); return exists; } pQueryHandle->activeIndex = 0; - pQueryHandle->checkFiles = false; + pQueryHandle->checkFiles = false; } // TODO: opt by consider the scan order -- GitLab