bobpaulin commented on code in PR #11872:
URL: https://github.com/apache/nifi/pull/11872#discussion_r4556407442


##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ConnectorResource.java:
##########
@@ -725,6 +732,36 @@ public Response updateRunStatus(
         );
     }
 
+    /**
+     * Each node verifies a START against its own Connector only, so the 
merged Connector entity is consulted to reject a START
+     * while the nodes load different Connector versions.
+     */
+    private void verifyClusterLoadsSameBundle() {
+        final URI runStatusUri = getAbsolutePath();
+        final String runStatusPath = runStatusUri.getPath();
+        final URI connectorUri = 
UriBuilder.fromUri(runStatusUri).replacePath(runStatusPath.substring(0, 
runStatusPath.lastIndexOf('/'))).build();
+
+        final NodeResponse nodeResponse;
+        try {
+            nodeResponse = replicateNodeResponse(connectorUri, HttpMethod.GET, 
new MultivaluedHashMap<>(), null);
+        } catch (final InterruptedException e) {
+            Thread.currentThread().interrupt();
+            throw new IllegalStateException("Interrupted while verifying the 
Connector version on each cluster node", e);
+        }
+
+        if (!(nodeResponse.getUpdatedEntity() instanceof final ConnectorEntity 
connectorEntity) || connectorEntity.getComponent() == null
+                || connectorEntity.getComponent().getAvailableActions() == 
null) {
+            return;
+        }
+
+        for (final ConnectorActionDTO action : 
connectorEntity.getComponent().getAvailableActions()) {
+            final String reason = action.getReasonNotAllowed();
+            if (reason != null && 
reason.startsWith(ConnectorEntityMerger.LOADED_BUNDLE_MISMATCH_REASON)) {

Review Comment:
   [Claude Opus 5.5] Done. The extra GET and the reason-text matching are 
removed. For a cluster START, the receiving node puts its loaded bundle on the 
run-status request as expectedBundle, and each node compares that coordinate 
with its own loaded bundle during validation, rejecting the start if they 
differ. So the check now happens inside the normal replicated PUT, and the 
merger's reason text is used only for display.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to