Skip to content

Commit

Permalink
Merge #76144
Browse files Browse the repository at this point in the history
76144: kvserver: enforce min duration for slow_replication_threshold r=erikgrinaker a=tbg

We've seen recent problems (#75728) related to mis-configured cluster
settings. Preemptively tighten the range of allowable values for the
`kv.replica_circuit_breaker.slow_replication_threshold` setting.

Touches #33007.

Release note: None


Co-authored-by: Tobias Grieger <[email protected]>
  • Loading branch information
craig[bot] and tbg committed Feb 11, 2022
2 parents 18e4193 + 2d8cc40 commit cd3458b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion pkg/kv/kvserver/replica_circuit_breaker.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,19 @@ var replicaCircuitBreakerSlowReplicationThreshold = settings.RegisterPublicDurat
"kv.replica_circuit_breaker.slow_replication_threshold",
"duration after which slow proposals trip the per-Replica circuit breaker (zero duration disables breakers)",
defaultReplicaCircuitBreakerSlowReplicationThreshold,
settings.NonNegativeDuration,
func(d time.Duration) error {
// Setting the breaker duration too low could be very dangerous to cluster
// health (breaking things to the point where the cluster setting can't be
// changed), so enforce a sane minimum.
const min = 500 * time.Millisecond
if d == 0 {
return nil
}
if d <= min {
return errors.Errorf("must specify a minimum of %s", min)
}
return nil
},
)

// Telemetry counter to count number of trip events.
Expand Down

0 comments on commit cd3458b

Please sign in to comment.