From 75b922c2befa865879a4be3c5514225dccb61189 Mon Sep 17 00:00:00 2001 From: Benguang Zhao Date: Wed, 22 Mar 2023 14:59:07 +0800 Subject: [PATCH] feat: retentionSize as 0 means unlimitted in size --- source/libs/wal/src/walWrite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/wal/src/walWrite.c b/source/libs/wal/src/walWrite.c index 00ad7a3d67..a8f9362757 100644 --- a/source/libs/wal/src/walWrite.c +++ b/source/libs/wal/src/walWrite.c @@ -327,7 +327,7 @@ int32_t walEndSnapshot(SWal *pWal) { wDebug("vgId:%d, wal check remove file %" PRId64 "(file size %" PRId64 " close ts %" PRId64 "), new tot size %" PRId64, 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 != -1 && pWal->cfg.retentionSize != 0 && newTotSize > pWal->cfg.retentionSize) || ((pWal->cfg.retentionPeriod == 0) || (pWal->cfg.retentionPeriod != -1 && iter->closeTs != -1 && iter->closeTs + pWal->cfg.retentionPeriod < ts))) { // delete according to file size or close time -- GitLab