You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ma...@apache.org on 2022/04/13 17:44:37 UTC

[nifi] branch main updated: NIFI-9893 - Ensure orderly cluster node removal on node delete via UI (#5946)

This is an automated email from the ASF dual-hosted git repository.

markap14 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/main by this push:
     new 3034f2637a NIFI-9893 - Ensure orderly cluster node removal on node delete via UI (#5946)
3034f2637a is described below

commit 3034f2637a99dca92fc7ab200e7d8a938f57916f
Author: greyp9 <gr...@users.noreply.github.com>
AuthorDate: Wed Apr 13 13:44:28 2022 -0400

    NIFI-9893 - Ensure orderly cluster node removal on node delete via UI (#5946)
---
 .../nifi/cluster/coordination/node/NodeClusterCoordinator.java     | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/node/NodeClusterCoordinator.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/node/NodeClusterCoordinator.java
index c0034ce492..19678ed1db 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/node/NodeClusterCoordinator.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/node/NodeClusterCoordinator.java
@@ -613,11 +613,12 @@ public class NodeClusterCoordinator implements ClusterCoordinator, ProtocolHandl
 
     @Override
     public void removeNode(final NodeIdentifier nodeId, final String userDn) {
-        reportEvent(nodeId, Severity.INFO, "User " + userDn + " requested that node be removed from cluster");
-        notifyOthersOfNodeStatusChange(new NodeConnectionStatus(nodeId, NodeConnectionState.REMOVED));
+        // Remove the node from the cluster state before any notifications are sent to the cluster participants.  This
+        // ensures that potential communication failures do not cause the operation to fail.
         removeNode(nodeId);
-
         storeState();
+        reportEvent(nodeId, Severity.INFO, "User " + userDn + " requested that node be removed from cluster");
+        notifyOthersOfNodeStatusChange(new NodeConnectionStatus(nodeId, NodeConnectionState.REMOVED));
     }
 
     private void onNodeRemoved(final NodeIdentifier nodeId) {