mirror of https://github.com/status-im/consul.git
Do not surface left servers (#6420)
* do not surface left servers in catalog
This commit is contained in:
parent
8d4b8eae38
commit
b6499fe6b8
|
@ -414,6 +414,12 @@ func (r *Router) GetDatacentersByDistance() ([]string, error) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if m.Status == serf.StatusLeft {
|
||||||
|
r.logger.Printf("[DEBUG]: consul: server %q in area %q left, skipping",
|
||||||
|
m.Name, areaID)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
existing := index[parts.Datacenter]
|
existing := index[parts.Datacenter]
|
||||||
if parts.Datacenter == r.localDatacenter {
|
if parts.Datacenter == r.localDatacenter {
|
||||||
// Everything in the local datacenter looks like zero RTT.
|
// Everything in the local datacenter looks like zero RTT.
|
||||||
|
@ -475,6 +481,12 @@ func (r *Router) GetDatacenterMaps() ([]structs.DatacenterMap, error) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if m.Status == serf.StatusLeft {
|
||||||
|
r.logger.Printf("[DEBUG]: consul: server %q in area %q left, skipping",
|
||||||
|
m.Name, areaID)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
coord, ok := info.cluster.GetCachedCoordinate(parts.Name)
|
coord, ok := info.cluster.GetCachedCoordinate(parts.Name)
|
||||||
if ok {
|
if ok {
|
||||||
entry := &structs.Coordinate{
|
entry := &structs.Coordinate{
|
||||||
|
|
Loading…
Reference in New Issue