remova level 0's empty wals when closing vnode

This commit is contained in:
Minglei Jin 2024-06-14 17:09:48 +08:00
parent 0adbf110d9
commit d47fe255ae
2 changed files with 8 additions and 2 deletions

View File

@ -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;

View File

@ -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) {