diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/endpoints/ComponentStateEndpointMerger.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/endpoints/ComponentStateEndpointMerger.java index 5ab71c934e..3b03ed0b1e 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/endpoints/ComponentStateEndpointMerger.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/endpoints/ComponentStateEndpointMerger.java @@ -74,8 +74,11 @@ public class ComponentStateEndpointMerger extends AbstractSingleDTOEndpoint dtoMap, Set successfulResponses, Set problematicResponses) { // The request for a Provenance Event is replicated to a single Node. We simply update its cluster node info. - final NodeIdentifier nodeId = successfulResponses.iterator().next().getNodeId(); - clientDto.setClusterNodeId(nodeId.getId()); - clientDto.setClusterNodeAddress(nodeId.getApiAddress() + ":" + nodeId.getApiPort()); + // However, we only do this if the cluster node info isn't set, because if this is replicated across the cluster, + // the cluster coordinator will have already set it, and we will be receiving the response from the cluster + // coordinator. We do not want to overwrite this value on all DTO's with the cluster coordinator's information. + if (clientDto.getClusterNodeId() == null || clientDto.getClusterNodeAddress() == null) { + final NodeIdentifier nodeId = successfulResponses.iterator().next().getNodeId(); + clientDto.setClusterNodeId(nodeId.getId()); + clientDto.setClusterNodeAddress(nodeId.getApiAddress() + ":" + nodeId.getApiPort()); + } } }