v0.9.6 Fix incorrectly leave
- Remove
mlist.Leave
fromregistry.Shutdown
method because callingleave
method will send a left message to remote peers and make its state to beStateLeft
. A node won't gossip messages toStateLeft
nodes any more. If left a cluster incorrectly by callingleave
method, the node won't have any chance to refute suspect or dead message to let remote peers know it still alive (or become alive again). - Add another package level method for leaving cluster
// Leave leaves the cluster on purpose
func Leave(timeout time.Duration) {
if mlist != nil {
_ = mlist.Leave(timeout)
logger.Info("local node left the cluster")
}
}