make retention work
This commit is contained in:
parent
37a2343b61
commit
be841955ae
|
@ -32,7 +32,7 @@ static int32_t tsdbDoRetentionImpl(STsdb *pTsdb, int64_t now, int8_t try, int8_t
|
||||||
SDiskID did;
|
SDiskID did;
|
||||||
|
|
||||||
// check
|
// check
|
||||||
if (expLevel == pDFileSet->fid) continue;
|
if (expLevel == pDFileSet->diskId.id) continue;
|
||||||
|
|
||||||
// delete or move
|
// delete or move
|
||||||
if (expLevel < 0) {
|
if (expLevel < 0) {
|
||||||
|
|
|
@ -480,11 +480,11 @@ int32_t tsdbFidLevel(int32_t fid, STsdbKeepCfg *pKeepCfg, int64_t now) {
|
||||||
}
|
}
|
||||||
|
|
||||||
key = now - pKeepCfg->keep0 * tsTickPerMin[pKeepCfg->precision];
|
key = now - pKeepCfg->keep0 * tsTickPerMin[pKeepCfg->precision];
|
||||||
aFid[0] = tsdbKeyFid(key, pKeepCfg->days, pKeepCfg->keep0);
|
aFid[0] = tsdbKeyFid(key, pKeepCfg->days, pKeepCfg->precision);
|
||||||
key = now - pKeepCfg->keep1 * tsTickPerMin[pKeepCfg->precision];
|
key = now - pKeepCfg->keep1 * tsTickPerMin[pKeepCfg->precision];
|
||||||
aFid[1] = tsdbKeyFid(key, pKeepCfg->days, pKeepCfg->keep1);
|
aFid[1] = tsdbKeyFid(key, pKeepCfg->days, pKeepCfg->precision);
|
||||||
key = now - pKeepCfg->keep2 * tsTickPerMin[pKeepCfg->precision];
|
key = now - pKeepCfg->keep2 * tsTickPerMin[pKeepCfg->precision];
|
||||||
aFid[2] = tsdbKeyFid(key, pKeepCfg->days, pKeepCfg->keep2);
|
aFid[2] = tsdbKeyFid(key, pKeepCfg->days, pKeepCfg->precision);
|
||||||
|
|
||||||
if (fid >= aFid[0]) {
|
if (fid >= aFid[0]) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -28,7 +28,7 @@ int vnodeCreate(const char *path, SVnodeCfg *pCfg, STfs *pTfs) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// create vnode env
|
// create vnode env
|
||||||
if (tfsMkdir(pTfs, path) < 0) {
|
if (tfsMkdirAt(pTfs, path, (SDiskID){0}) < 0) {
|
||||||
vError("vgId:%d, failed to create vnode since: %s", pCfg->vgId, tstrerror(terrno));
|
vError("vgId:%d, failed to create vnode since: %s", pCfg->vgId, tstrerror(terrno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue