Cluster: follower peers should ignore alerts/re-allocations.
This commit is contained in:
parent
d2042b8092
commit
ad1e739bfb
10
cluster.go
10
cluster.go
|
@ -395,6 +395,12 @@ func (c *Cluster) alertsHandler() {
|
||||||
case <-c.ctx.Done():
|
case <-c.ctx.Done():
|
||||||
return
|
return
|
||||||
case alrt := <-c.monitor.Alerts():
|
case alrt := <-c.monitor.Alerts():
|
||||||
|
// Follower peers do not care about alerts.
|
||||||
|
// They can do nothing about them.
|
||||||
|
if c.config.FollowerMode {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
logger.Warningf("metric alert for %s: Peer: %s.", alrt.MetricName, alrt.Peer)
|
logger.Warningf("metric alert for %s: Peer: %s.", alrt.MetricName, alrt.Peer)
|
||||||
if alrt.MetricName != pingMetricName {
|
if alrt.MetricName != pingMetricName {
|
||||||
continue // only handle ping alerts
|
continue // only handle ping alerts
|
||||||
|
@ -1370,7 +1376,9 @@ func (c *Cluster) pin(
|
||||||
// Usually allocations are unset when pinning normally, however, the
|
// Usually allocations are unset when pinning normally, however, the
|
||||||
// allocations may have been preset by the adder in which case they
|
// allocations may have been preset by the adder in which case they
|
||||||
// need to be respected. Whenever allocations are set. We don't
|
// need to be respected. Whenever allocations are set. We don't
|
||||||
// re-allocate.
|
// re-allocate. repinFromPeer() unsets allocations for this reason.
|
||||||
|
// allocate() will check which peers are currently allocated
|
||||||
|
// and try to respect them.
|
||||||
if len(pin.Allocations) == 0 {
|
if len(pin.Allocations) == 0 {
|
||||||
allocs, err := c.allocate(
|
allocs, err := c.allocate(
|
||||||
ctx,
|
ctx,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user