diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/endpoints/ProvenanceQueryEndpointMerger.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/endpoints/ProvenanceQueryEndpointMerger.java index 6e0e2b5130..6838e39157 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/endpoints/ProvenanceQueryEndpointMerger.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/endpoints/ProvenanceQueryEndpointMerger.java @@ -98,10 +98,17 @@ public class ProvenanceQueryEndpointMerger implements EndpointResponseMerger { // populate the cluster identifier for (final ProvenanceEventDTO eventDto : nodeResultDto.getProvenanceEvents()) { - eventDto.setClusterNodeId(nodeIdentifier.getId()); - eventDto.setClusterNodeAddress(nodeAddress); - // add node identifier to the event's id so that it is unique across cluster - eventDto.setId(nodeIdentifier.getId() + eventDto.getId()); + // if the cluster node id or node address is not set, then we need to populate them. If they + // are already set, we don't want to populate them because it will be the case that they were populated + // by the Cluster Coordinator when it federated the request, and we are now just receiving the response + // from the Cluster Coordinator. + if (eventDto.getClusterNodeId() == null || eventDto.getClusterNodeAddress() == null) { + eventDto.setClusterNodeId(nodeIdentifier.getId()); + eventDto.setClusterNodeAddress(nodeAddress); + // add node identifier to the event's id so that it is unique across cluster + eventDto.setId(nodeIdentifier.getId() + eventDto.getId()); + } + allResults.add(eventDto); } }