Ensure orderly cluster node removal on node delete via UI
@@ -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) {
