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 <lirenzuo@shein.com>
This commit is contained in:
匠心零度 2021-05-13 16:14:51 +08:00 committed by Aliaksandr Valialkin
parent f13585dc5d
commit d5285ecaf0

View File

@ -768,7 +768,7 @@ func needSkipScrapeWork(key string, membersCount, replicasCount, memberNum int)
return false
}
idx++
if idx >= replicasCount {
if idx >= membersCount {
idx = 0
}
}