From d346d00efc99c53c9f2567287332d252bd0eea7c Mon Sep 17 00:00:00 2001 From: Nikolay Eskov Date: Thu, 5 Dec 2024 12:59:20 +0300 Subject: [PATCH] Increase aleert vacuum quota for L2 analyzer. This fixes premature 'Resolved' alert sending. --- pkg/analysis/l2/l2analyzer.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/analysis/l2/l2analyzer.go b/pkg/analysis/l2/l2analyzer.go index 145e693b..73459d3d 100644 --- a/pkg/analysis/l2/l2analyzer.go +++ b/pkg/analysis/l2/l2analyzer.go @@ -146,7 +146,14 @@ func vacuumAlerts( } } -const defaultAlertVacuumQuota = int(l2NodesSameHeightTimerDuration/heightCollectorTimeout) + 1 +// defaultAlertVacuumQuota is a default value for the alerts storage vacuum quota. +// It is calculated as the number of vacuum stages required to vacuum an alert. +// The formula is: l2NodesSameHeightTimerDuration / heightCollectorTimeout + 1 + 4, where: +// - l2NodesSameHeightTimerDuration is the duration of the timer that triggers the alert about the same height of an L2, +// - heightCollectorTimeout is the timeout of the height collector, +// - 1 is added to compensate the first vacuum stage, +// - 2 is added to survive the vacuum stage after the last alert. +const defaultAlertVacuumQuota = int(l2NodesSameHeightTimerDuration/heightCollectorTimeout) + 1 + 2 func analyzerLoop( ctx context.Context,