Skip to content

Commit

Permalink
Fix: fail messages after a node rename replace the new node definition
Browse files Browse the repository at this point in the history
When receiving a serf faild message for a node which is not in the
catalog, do not perform a register request to set is serf heath to
critical as it could overwrite the node information and services if it
was renamed.

Fixes : hashicorp#5518
  • Loading branch information
Thibault Gilles committed Mar 21, 2019
1 parent 6becd97 commit 356a821
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion agent/consul/leader.go
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,13 @@ func (s *Server) handleFailedMember(member serf.Member) error {
if err != nil {
return err
}
if node != nil && node.Address == member.Addr.String() {

if node == nil {
s.logger.Printf("[INFO] consul: ignoring failed event for member '%s' because it does not exist in the catalog", member.Name)
return nil
}

if node.Address == member.Addr.String() {
// Check if the serfCheck is in the critical state
_, checks, err := state.NodeChecks(nil, member.Name)
if err != nil {
Expand Down

0 comments on commit 356a821

Please sign in to comment.