Skip to content

Commit

Permalink
Don't forget peer data if we never got data
Browse files Browse the repository at this point in the history
  • Loading branch information
cvaroqui committed Aug 17, 2018
1 parent e7cbe9d commit 76a2f2e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/hb.py
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 76a2f2e

Please sign in to comment.