Merge pull request #20298 from taosdata/FIX/TD-22829-main

fix: check pWal->cfg.retentionPeriod properly
This commit is contained in:
Shengliang Guan 2023-03-08 11:01:32 +08:00 committed by GitHub
commit e37ca08bbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -328,8 +328,8 @@ int32_t walEndSnapshot(SWal *pWal) {
"), new tot size %" PRId64, "), new tot size %" PRId64,
pWal->cfg.vgId, iter->firstVer, iter->fileSize, iter->closeTs, newTotSize); pWal->cfg.vgId, iter->firstVer, iter->fileSize, iter->closeTs, newTotSize);
if (((pWal->cfg.retentionSize == 0) || (pWal->cfg.retentionSize != -1 && newTotSize > pWal->cfg.retentionSize)) || if (((pWal->cfg.retentionSize == 0) || (pWal->cfg.retentionSize != -1 && newTotSize > pWal->cfg.retentionSize)) ||
((pWal->cfg.retentionPeriod == 0) || ((pWal->cfg.retentionPeriod == 0) || (pWal->cfg.retentionPeriod != -1 && iter->closeTs != -1 &&
(pWal->cfg.retentionPeriod != -1 && iter->closeTs + pWal->cfg.retentionPeriod > ts))) { iter->closeTs + pWal->cfg.retentionPeriod < ts))) {
// delete according to file size or close time // delete according to file size or close time
wDebug("vgId:%d, check pass", pWal->cfg.vgId); wDebug("vgId:%d, check pass", pWal->cfg.vgId);
deleteCnt++; deleteCnt++;