Fix: fail messages after a node rename replace the new node definition (#5520)

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 : #5518
This commit is contained in:
Aestek 2019-04-26 22:33:41 +02:00 committed by Paul Banks
parent 3ea9fe3bff
commit 9813abcb09
1 changed files with 7 additions and 1 deletions

View File

@ -1415,7 +1415,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 {