Do not update status for stopping a deleted node
@@ -1059,6 +1059,11 @@ public class NodeClusterCoordinator implements ClusterCoordinator, ProtocolHandl
final NodeConnectionStatus oldStatus = nodeStatuses.get(statusChangeMessage.getNodeId().getId());
+ if (oldStatus == null && updatedStatus.getState() == NodeConnectionState.DISCONNECTED ) {
+ // There is no need to tell that node is getting disconnected if there was no status earlier.
+ return;
+ }
+
// Either remove the value from the map or update the map depending on the connection state
if (statusChangeMessage.getNodeConnectionStatus().getState() == NodeConnectionState.REMOVED) {
if (removeNodeConditionally(nodeId, oldStatus)) {
