[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);
             }