From 2cfdf228972a82d741df69a7a96bcf89571be8ee Mon Sep 17 00:00:00 2001 From: yukun Date: Fri, 15 Oct 2021 15:44:35 +0800 Subject: [PATCH] Change retention ticker time to 10 minutes (#9933) Signed-off-by: fishpenguin --- internal/util/rocksmq/server/rocksmq/rocksmq_retention.go | 6 +++--- .../util/rocksmq/server/rocksmq/rocksmq_retention_test.go | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/util/rocksmq/server/rocksmq/rocksmq_retention.go b/internal/util/rocksmq/server/rocksmq/rocksmq_retention.go index 3eb1d15aad..fbd9404db5 100644 --- a/internal/util/rocksmq/server/rocksmq/rocksmq_retention.go +++ b/internal/util/rocksmq/server/rocksmq/rocksmq_retention.go @@ -33,15 +33,15 @@ var RocksmqRetentionTimeInMinutes int64 // RocksmqRetentionSizeInMB is the size of retention var RocksmqRetentionSizeInMB int64 -// TickerTimeInSeconds is the time of expired check -var TickerTimeInSeconds int64 = 6 - // Const value that used to convert unit const ( MB = 2 << 20 MINUTE = 60 ) +// TickerTimeInSeconds is the time of expired check, default 10 minutes +var TickerTimeInSeconds int64 = 10 * MINUTE + type topicPageInfo struct { pageEndID []UniqueID pageMsgSize map[UniqueID]int64 diff --git a/internal/util/rocksmq/server/rocksmq/rocksmq_retention_test.go b/internal/util/rocksmq/server/rocksmq/rocksmq_retention_test.go index 343db3be3d..d3cc9154cd 100644 --- a/internal/util/rocksmq/server/rocksmq/rocksmq_retention_test.go +++ b/internal/util/rocksmq/server/rocksmq/rocksmq_retention_test.go @@ -34,6 +34,7 @@ func TestMain(m *testing.M) { log.Error("MkdirALl error for path", zap.Any("path", retentionPath)) return } + atomic.StoreInt64(&TickerTimeInSeconds, 6) code := m.Run() os.Exit(code) }