kfaraz commented on code in PR #19541:
URL: https://github.com/apache/druid/pull/19541#discussion_r3401689497


##########
indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorManager.java:
##########
@@ -209,24 +328,18 @@ public boolean shouldUpdateSupervisor(SupervisorSpec spec)
     Preconditions.checkNotNull(spec.getDataSources(), "spec.getDatasources()");
     synchronized (lock) {
       Preconditions.checkState(started, "SupervisorManager not started");
-      try {
-        byte[] specAsBytes = jsonMapper.writeValueAsBytes(spec);
-        Pair<Supervisor, SupervisorSpec> currentSupervisor = 
supervisors.get(spec.getId());
-        if (currentSupervisor == null || currentSupervisor.rhs == null) {
-          return true;
-        } else if (Arrays.equals(specAsBytes, 
jsonMapper.writeValueAsBytes(currentSupervisor.rhs))) {
-          return false;
-        } else {
-          // The spec bytes are different, so we need to check if the update 
is allowed
-          currentSupervisor.rhs.validateSpecUpdateTo(spec);
-          return true;
-        }
+      final Pair<Supervisor, SupervisorSpec> currentSupervisor = 
supervisors.get(spec.getId());
+      if (currentSupervisor == null || currentSupervisor.rhs == null) {
+        return true;
       }
-      catch (JsonProcessingException ex) {
-        log.warn("Failed to write spec as bytes for spec_id[%s]", 
spec.getId());
+      // Identical specs never require a restart. Otherwise (after validating 
the update is allowed)
+      // let the spec decide whether the differences actually warrant a 
restart — e.g. a taskCount-only
+      // change under autoscaling does not.

Review Comment:
   this comment probably doesn't make sense here since this method pertains 
only with "update" and not "restart".



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to