diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 89d256fce0..2bdee5e3bf 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -7275,7 +7275,7 @@ static int32_t translateAlterDatabase(STranslateContext* pCxt, SAlterDatabaseStm "Invalid option, wal_level 0 should be used with replica 1"); } } - /* +#if 0 if (pStmt->pOptions->replica > 1 && pStmt->pOptions->walLevel < 1) { SDbCfgInfo dbCfg = {0}; dbCfg.walLevel = -1; @@ -7285,7 +7285,7 @@ static int32_t translateAlterDatabase(STranslateContext* pCxt, SAlterDatabaseStm "Invalid option, wal_level 0 should be used with replica 1"); } } - */ +#endif int32_t code = checkDatabaseOptions(pCxt, pStmt->dbName, pStmt->pOptions); if (TSDB_CODE_SUCCESS != code) { return code; diff --git a/source/libs/wal/src/walMgmt.c b/source/libs/wal/src/walMgmt.c index 54e6abd85a..219bbd9664 100644 --- a/source/libs/wal/src/walMgmt.c +++ b/source/libs/wal/src/walMgmt.c @@ -233,6 +233,12 @@ void walClose(SWal *pWal) { taosThreadMutexUnlock(&pWal->mutex); taosRemoveRef(tsWal.refSetId, pWal->refId); + + if (pWal->cfg.level == TAOS_WAL_SKIP) { + wInfo("vgId:%d, remove all wals, path:%s", pWal->cfg.vgId, pWal->path); + taosRemoveDir(pWal->path); + taosMkDir(pWal->path); + } } static void walFreeObj(void *wal) {