diff --git a/source/dnode/vnode/src/sma/smaFS.c b/source/dnode/vnode/src/sma/smaFS.c index acb529bb9e2df955c56e1bd94303eec2bd70e4b8..4387db553e6cfe21c0e14ff7b57ea388552ec969 100644 --- a/source/dnode/vnode/src/sma/smaFS.c +++ b/source/dnode/vnode/src/sma/smaFS.c @@ -33,6 +33,8 @@ int32_t tdRSmaFSOpen(SSma *pSma, int64_t version) { SSmaEnv *pEnv = SMA_RSMA_ENV(pSma); SRSmaStat *pStat = NULL; SArray *output = NULL; + + terrno = TSDB_CODE_SUCCESS; if (!pEnv) { return TSDB_CODE_SUCCESS; @@ -62,7 +64,7 @@ _end: } taosArrayDestroy(output); - if (terrno != 0) { + if (terrno != TSDB_CODE_SUCCESS) { smaError("vgId:%d, open rsma fs failed since %s", TD_VID(pVnode), terrstr()); return TSDB_CODE_FAILED; } @@ -138,6 +140,11 @@ static int32_t tdFetchQTaskInfoFiles(SSma *pSma, int64_t version, SArray **outpu tdGetVndDirName(TD_VID(pVnode), tfsGetPrimaryPath(pVnode->pTfs), VNODE_RSMA_DIR, true, dir); + if (!taosCheckExistFile(dir)) { + smaDebug("vgId:%d, fetch qtask files, no need as dir %s not exist", TD_VID(pVnode), dir); + return TSDB_CODE_SUCCESS; + } + // Resource allocation and init if ((code = regcomp(®ex, pattern, REG_EXTENDED)) != 0) { terrno = TSDB_CODE_RSMA_REGEX_MATCH; @@ -150,7 +157,7 @@ static int32_t tdFetchQTaskInfoFiles(SSma *pSma, int64_t version, SArray **outpu if (!(pDir = taosOpenDir(dir))) { regfree(®ex); terrno = TAOS_SYSTEM_ERROR(errno); - smaDebug("vgId:%d, fetch qtask files, open dir %s failed since %s", TD_VID(pVnode), dir, terrstr()); + smaError("vgId:%d, fetch qtask files, open dir %s failed since %s", TD_VID(pVnode), dir, terrstr()); return TSDB_CODE_FAILED; } diff --git a/source/dnode/vnode/src/sma/smaRollup.c b/source/dnode/vnode/src/sma/smaRollup.c index 8fcc37115342414404b0553666dc06fd1f545778..6732403846cd7cde989ee1cc9a3d4b024e14cfee 100644 --- a/source/dnode/vnode/src/sma/smaRollup.c +++ b/source/dnode/vnode/src/sma/smaRollup.c @@ -1635,7 +1635,7 @@ static void tdRSmaFetchTrigger(void *param, void *tmrId) { atomic_val_compare_exchange_8(&pItem->triggerStat, TASK_TRIGGER_STAT_ACTIVE, TASK_TRIGGER_STAT_INACTIVE); switch (fetchTriggerStat) { case TASK_TRIGGER_STAT_ACTIVE: { - smaInfo("vgId:%d, rsma fetch task planned for level:%" PRIi8 " suid:%" PRIi64 " since stat is active", + smaDebug("vgId:%d, rsma fetch task planned for level:%" PRIi8 " suid:%" PRIi64 " since stat is active", SMA_VID(pSma), pItem->level, pRSmaInfo->suid); // async process pItem->fetchLevel = pItem->level; @@ -1704,7 +1704,7 @@ static int32_t tdRSmaFetchAllResult(SSma *pSma, SRSmaInfo *pInfo) { SMA_VID(pSma), pInfo->suid, i, pItem->nSkipped, pItem->maxDelay); } else if (((curMs - pInfo->lastRecv) < RSMA_FETCH_ACTIVE_MAX)) { ++pItem->nSkipped; - smaInfo("vgId:%d, suid:%" PRIi64 " level:%" PRIi8 " curMs:%" PRIi64 " lastRecv:%" PRIi64 ", fetch skipped ", + smaDebug("vgId:%d, suid:%" PRIi64 " level:%" PRIi8 " curMs:%" PRIi64 " lastRecv:%" PRIi64 ", fetch skipped ", SMA_VID(pSma), pInfo->suid, i, curMs, pInfo->lastRecv); continue; } else {