Only adjust downward if we have a total >= original estimate

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2021-09-27 18:39:37 -07:00
parent 8223275c44
commit 74e2034aed

View File

@@ -818,8 +818,9 @@ func (js *jetStream) monitorCluster() {
continue
}
// If we are here we do not have a leader and we did not have a previous one, so cold start.
// Check to see if we can adjust our cluster size.
if js, total := s.trackedJetStreamServers(); js < total {
// Check to see if we can adjust our cluster size down iff we are in mixed mode and we have
// seen a total that is what our original estimate was.
if js, total := s.trackedJetStreamServers(); js < total && total >= n.ClusterSize() {
n.AdjustBootClusterSize(js)
}
}