commit | 1315d3e9f66417a1c62b216d81dbd6fa0425e150 | [log] [tgz] |
---|---|---|
author | Jordan Halterman <jordan@opennetworking.org> | Tue Jan 16 19:41:31 2018 -0800 |
committer | Thomas Vachuska <tom@opennetworking.org> | Wed Jan 17 20:04:02 2018 +0000 |
tree | eb07d272da462f6100524165ab3b4ae56a65485e | |
parent | 01e886eb361d1c262df661047f3db52e939d263d [diff] |
[ONOS-7381] Reset phi accrual failure detectors when nodes are re-activated Change-Id: I283ef9daca8dedcc1260a7e5299f559ee7a1c6e0
diff --git a/core/store/dist/src/main/java/org/onosproject/store/cluster/impl/DistributedClusterStore.java b/core/store/dist/src/main/java/org/onosproject/store/cluster/impl/DistributedClusterStore.java index b106763..d884c26 100644 --- a/core/store/dist/src/main/java/org/onosproject/store/cluster/impl/DistributedClusterStore.java +++ b/core/store/dist/src/main/java/org/onosproject/store/cluster/impl/DistributedClusterStore.java
@@ -334,6 +334,10 @@ public void accept(Endpoint sender, byte[] message) { HeartbeatMessage hb = SERIALIZER.decode(message); if (clusterMetadataService.getClusterMetadata().getNodes().contains(hb.source())) { + State state = nodeStates.get(hb.source().id()); + if (state != null && !state.isActive() && hb.state.isActive()) { + failureDetector.reset(hb.source().id()); + } failureDetector.report(hb.source().id()); updateNode(hb.source().id(), hb.state, hb.version); }
diff --git a/core/store/dist/src/main/java/org/onosproject/store/cluster/impl/PhiAccrualFailureDetector.java b/core/store/dist/src/main/java/org/onosproject/store/cluster/impl/PhiAccrualFailureDetector.java index 590946d..922057f 100644 --- a/core/store/dist/src/main/java/org/onosproject/store/cluster/impl/PhiAccrualFailureDetector.java +++ b/core/store/dist/src/main/java/org/onosproject/store/cluster/impl/PhiAccrualFailureDetector.java
@@ -75,7 +75,14 @@ } } - + /** + * Resets the failure detector for the given node. + * + * @param nodeId node identifier for the node for which to reset the failure detector + */ + public void reset(NodeId nodeId) { + states.put(nodeId, new History()); + } /** * Compute phi for the specified node id.