mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-30 07:03:06 -08:00
Merge pull request #3170 from tomwilkie/1.7-2969-negative-shards
Prevent number of remote write shards from going negative.
This commit is contained in:
commit
df4bc3e407
|
@ -339,6 +339,8 @@ func (t *QueueManager) calculateDesiredShards() {
|
|||
numShards := int(math.Ceil(desiredShards))
|
||||
if numShards > t.cfg.MaxShards {
|
||||
numShards = t.cfg.MaxShards
|
||||
} else if numShards < 1 {
|
||||
numShards = 1
|
||||
}
|
||||
if numShards == t.numShards {
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue