remova level 0's empty wals when closing vnode
This commit is contained in:
parent
0adbf110d9
commit
d47fe255ae
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue