From 76a2f2edf1426b7235b9eb30897ffb26a7cf7e02 Mon Sep 17 00:00:00 2001 From: Christophe Varoqui Date: Fri, 17 Aug 2018 12:27:31 +0200 Subject: [PATCH] Don't forget peer data if we never got data --- lib/hb.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/hb.py b/lib/hb.py index 3c326f24bd..14a50ea231 100644 --- a/lib/hb.py +++ b/lib/hb.py @@ -96,7 +96,7 @@ def set_beating(self, nodename="*"): else: self.log.info("node %s hb status beating => stale", nodename) self.peers[nodename].beating = beating - if not beating: + if not beating and self.peers[nodename].last > 0: self.forget_peer_data(nodename, change) @staticmethod @@ -164,11 +164,11 @@ def store_rx_data(self, data, nodename): kind = data.get("kind", "full") change = False if kind == "patch": - if shared.REMOTE_GEN.get(nodename, 0) == 0: + if current_gen == 0: # waiting for a full: ignore patches return if nodename not in shared.CLUSTER_DATA: - # happens during init. drop the patch, a full will follow + # happens during init. ignore the patch, and ask for a full shared.REMOTE_GEN[nodename] = 0 shared.LOCAL_GEN[nodename] = our_gen_on_peer return