From d5285ecaf0d3acd71e0194a0bcb0d0bb4cff248d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=A0=E5=BF=83=E9=9B=B6=E5=BA=A6?= <97019752@qq.com> Date: Thu, 13 May 2021 16:14:51 +0800 Subject: [PATCH] fix vagent imbalance problem (#1292) /path/to/vmagent -promscrape.cluster.membersCount=3 -promscrape.cluster.replicationFactor=2 -promscrape.cluster.memberNum=0 -promscrape.config=/path/to/config.yml ... /path/to/vmagent -promscrape.cluster.membersCount=3 -promscrape.cluster.replicationFactor=2 -promscrape.cluster.memberNum=1 -promscrape.config=/path/to/config.yml ... /path/to/vmagent -promscrape.cluster.membersCount=3 -promscrape.cluster.replicationFactor=2 -promscrape.cluster.memberNum=2 -promscrape.config=/path/to/config.yml ... Co-authored-by: lirenzuo --- lib/promscrape/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/promscrape/config.go b/lib/promscrape/config.go index dc03d686ed..a100288d9b 100644 --- a/lib/promscrape/config.go +++ b/lib/promscrape/config.go @@ -768,7 +768,7 @@ func needSkipScrapeWork(key string, membersCount, replicasCount, memberNum int) return false } idx++ - if idx >= replicasCount { + if idx >= membersCount { idx = 0 } }