diff --git a/source/dnode/vnode/src/sma/smaCommit.c b/source/dnode/vnode/src/sma/smaCommit.c index fb5caad2691fca40e136ad204b0a90ac700d4337..db5f4c55b983a5f950694358235fbf61f4bf9f56 100644 --- a/source/dnode/vnode/src/sma/smaCommit.c +++ b/source/dnode/vnode/src/sma/smaCommit.c @@ -161,10 +161,12 @@ static int32_t tdProcessRSmaSyncPreCommitImpl(SSma *pSma) { * @return int32_t */ static int32_t tdProcessRSmaSyncCommitImpl(SSma *pSma) { +#if 0 SSmaEnv *pSmaEnv = SMA_RSMA_ENV(pSma); if (!pSmaEnv) { return TSDB_CODE_SUCCESS; } +#endif return TSDB_CODE_SUCCESS; } diff --git a/source/dnode/vnode/src/sma/smaRollup.c b/source/dnode/vnode/src/sma/smaRollup.c index 1924f803d61612af6e77e2f610b71925fca66de6..89c3dfff11bc341771afd0d458e71886daaeccce 100644 --- a/source/dnode/vnode/src/sma/smaRollup.c +++ b/source/dnode/vnode/src/sma/smaRollup.c @@ -1932,7 +1932,8 @@ int32_t tdRSmaProcessExecImpl(SSma *pSma, ERsmaExecType type) { int8_t oldStat = atomic_val_compare_exchange_8(RSMA_COMMIT_STAT(pRSmaStat), 0, 2); if (oldStat == 0 || ((oldStat == 2) && atomic_load_8(RSMA_TRIGGER_STAT(pRSmaStat)) < TASK_TRIGGER_STAT_PAUSED)) { - atomic_fetch_add_32(&pRSmaStat->nFetchAll, 1); + int32_t oldVal = atomic_fetch_add_32(&pRSmaStat->nFetchAll, 1); + ASSERT(oldVal >= 0); tdRSmaFetchAllResult(pSma, pInfo); if (0 == atomic_sub_fetch_32(&pRSmaStat->nFetchAll, 1)) { atomic_store_8(RSMA_COMMIT_STAT(pRSmaStat), 0); diff --git a/source/dnode/vnode/src/sma/smaSnapshot.c b/source/dnode/vnode/src/sma/smaSnapshot.c index 4939fce20c1f672390551a906cac95c46eceef1a..34f884f9f95776be10f1416fdf50f99a8fafce6e 100644 --- a/source/dnode/vnode/src/sma/smaSnapshot.c +++ b/source/dnode/vnode/src/sma/smaSnapshot.c @@ -373,7 +373,11 @@ int32_t rsmaSnapWriterClose(SRSmaSnapWriter** ppWriter, int8_t rollback) { // TODO: rsma1/rsma2 // qtaskinfo if (pWriter->pQTaskFWriter) { - taosRemoveFile(pWriter->pQTaskFWriter->fname); + if (taosRemoveFile(pWriter->pQTaskFWriter->fname) != 0) { + smaWarn("vgId:%d, vnode snapshot rsma writer failed to remove %s since %s", SMA_VID(pWriter->pSma), + pWriter->pQTaskFWriter->fname ? pWriter->pQTaskFWriter->fname : "NULL", + tstrerror(TAOS_SYSTEM_ERROR(errno))); + } } } else { // rsma1/rsma2 diff --git a/source/libs/tfs/inc/tfsInt.h b/source/libs/tfs/inc/tfsInt.h index 2a508cf676f744d0ffd09e4b656fcb15df63c82a..8e77dc8c0cfbc69d116a2f874aa24a5b01256e1d 100644 --- a/source/libs/tfs/inc/tfsInt.h +++ b/source/libs/tfs/inc/tfsInt.h @@ -57,7 +57,7 @@ typedef struct { typedef struct STfsDir { SDiskIter iter; SDiskID did; - char dirname[TSDB_FILENAME_LEN]; + char dirName[TSDB_FILENAME_LEN]; STfsFile tfile; TdDirPtr pDir; STfs *pTfs; diff --git a/source/libs/tfs/src/tfs.c b/source/libs/tfs/src/tfs.c index 4600e5e568fc5644024c633e08328a54247b28b5..b8786a85a971b658ebc91b2040c5b7078ac9fbfb 100644 --- a/source/libs/tfs/src/tfs.c +++ b/source/libs/tfs/src/tfs.c @@ -332,7 +332,7 @@ STfsDir *tfsOpendir(STfs *pTfs, const char *rname) { SDiskID diskId = {.id = 0, .level = 0}; pDir->iter.pDisk = TFS_DISK_AT(pTfs, diskId); pDir->pTfs = pTfs; - tstrncpy(pDir->dirname, rname, TSDB_FILENAME_LEN); + tstrncpy(pDir->dirName, rname, TSDB_FILENAME_LEN); if (tfsOpendirImpl(pTfs, pDir) < 0) { taosMemoryFree(pDir); @@ -354,10 +354,10 @@ const STfsFile *tfsReaddir(STfsDir *pTfsDir) { char *name = taosGetDirEntryName(pDirEntry); if (strcmp(name, ".") == 0 || strcmp(name, "..") == 0) continue; - if (pTfsDir->dirname == NULL || pTfsDir->dirname[0] == 0) { + if (pTfsDir->dirName[0] == 0) { snprintf(bname, TMPNAME_LEN * 2, "%s", name); } else { - snprintf(bname, TMPNAME_LEN * 2, "%s%s%s", pTfsDir->dirname, TD_DIRSEP, name); + snprintf(bname, TMPNAME_LEN * 2, "%s%s%s", pTfsDir->dirName, TD_DIRSEP, name); } tfsInitFile(pTfsDir->pTfs, &pTfsDir->tfile, pTfsDir->did, bname); @@ -523,9 +523,9 @@ static int32_t tfsOpendirImpl(STfs *pTfs, STfsDir *pTfsDir) { pTfsDir->did.id = pDisk->id; if (pDisk->path == NULL || pDisk->path[0] == 0) { - snprintf(adir, TMPNAME_LEN * 2, "%s", pTfsDir->dirname); + snprintf(adir, TMPNAME_LEN * 2, "%s", pTfsDir->dirName); } else { - snprintf(adir, TMPNAME_LEN * 2, "%s%s%s", pDisk->path, TD_DIRSEP, pTfsDir->dirname); + snprintf(adir, TMPNAME_LEN * 2, "%s%s%s", pDisk->path, TD_DIRSEP, pTfsDir->dirName); } pTfsDir->pDir = taosOpenDir(adir); if (pTfsDir->pDir != NULL) break;