From 368fe6d090eb5a9b316ac97130978f944f3b2ce7 Mon Sep 17 00:00:00 2001 From: Artem Fetishev Date: Tue, 12 May 2026 13:29:08 +0200 Subject: [PATCH] fix max uint32 for 32-bit systems Signed-off-by: Artem Fetishev --- app/vmstorage/main.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/vmstorage/main.go b/app/vmstorage/main.go index c54df95678..583d2b56da 100644 --- a/app/vmstorage/main.go +++ b/app/vmstorage/main.go @@ -187,11 +187,15 @@ func Init(resetCacheIfNeeded func(mrs []storage.MetricRow)) { fs.RegisterPathFsMetrics(*DataPath) var err error - if *accountID > math.MaxUint32 { - logger.Fatalf("-accountID must to be in the range [0, %d], got %d", math.MaxUint32, *accountID) + const ( + maxAccountID = uint64(math.MaxUint32) + maxProjectID = uint64(math.MaxUint32) + ) + if *accountID > maxAccountID { + logger.Fatalf("-accountID must to be in the range [0, %d], got %d", maxAccountID, *accountID) } - if *projectID > math.MaxUint32 { - logger.Fatalf("-projectID must to be in the range [0, %d], got %d", math.MaxUint32, *projectID) + if *projectID > maxProjectID { + logger.Fatalf("-projectID must to be in the range [0, %d], got %d", maxProjectID, *projectID) } vmselectSrv, err = servers.NewVMSelectServer(*vmselectAddr, strg, uint32(*accountID), uint32(*projectID)) if err != nil {