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:
Björn Rabenstein 2017-09-14 13:29:34 +02:00 committed by GitHub
commit df4bc3e407
1 changed files with 2 additions and 0 deletions

View File

@ -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