jordanly commented on a change in pull request #37: Staggered (Variable batch) 
Updates
URL: https://github.com/apache/aurora/pull/37#discussion_r221010750
 
 

 ##########
 File path: 
src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
 ##########
 @@ -792,9 +796,51 @@ public Response startJobUpdate(JobUpdateRequest 
mutableRequest, @Nullable String
       return invalidRequest(NON_SERVICE_TASK);
     }
 
+    int totalInstancesFromGroups;
     JobUpdateSettings settings = requireNonNull(mutableRequest.getSettings());
-    if (settings.getUpdateGroupSize() <= 0) {
-      return invalidRequest(INVALID_GROUP_SIZE);
+
+    // Gracefully handle a client sending an update with an older thrift schema
+    // TODO(rdelvalle): Remove after version 0.22.0 ships
+    if (!settings.isSetUpdateStrategy()) {
+      if (settings.isWaitForBatchCompletion()) {
+        settings.setUpdateStrategy(
+            JobUpdateStrategy.batchStrategy(
+                new 
BatchJobUpdateStrategy().setGroupSize(settings.getUpdateGroupSize())));
+      } else {
+        settings.setUpdateStrategy(
+            JobUpdateStrategy.queueStrategy(
+                new 
QueueJobUpdateStrategy().setGroupSize(settings.getUpdateGroupSize())));
+      }
+    }
+
+    // Keep old job schema in case we want to revert to a lower version of 
Aurora that doesn't
 
 Review comment:
   Just a thought: is it still possible to create an update outside of the CLI 
(calling the API directly) without these fields (or setting them as null)? If 
so, new updates will not have this field set so they could crash the scheduler 
on a downgrade.
   
   I don't have strong feelings on this since it is probably unlikely, but 
wanted to alert to the possibility.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to