Copilot commented on code in PR #62747:
URL: https://github.com/apache/doris/pull/62747#discussion_r3129046255


##########
fe/fe-core/src/main/java/org/apache/doris/job/extensions/insert/streaming/StreamingInsertJob.java:
##########
@@ -792,6 +843,11 @@ private void modifyPropertiesInternal(Map<String, String> 
inputProperties) throw
                 resetCloudProgress(offset);
             }
         }
+        String newGroup = inputStreamProps.getComputeGroup();
+        if (StringUtils.isNotEmpty(newGroup)) {
+            this.cloudCluster = newGroup;
+            pushCloudClusterToOffsetProvider();
+        }
         this.properties.putAll(inputProperties);

Review Comment:
   `compute_group` handling on ALTER/REPLAY can become inconsistent when the 
key is present but the value is empty ("" / whitespace). 
`modifyPropertiesInternal()` only updates `cloudCluster` when 
`StringUtils.isNotEmpty(newGroup)`; however it still `putAll()` the properties, 
so the persisted `properties` can show `compute_group` cleared while the job 
continues routing tasks/RPCs using the previous `cloudCluster`. Also, in 
non-cloud mode an empty `compute_group` value would bypass the current 
non-cloud rejection logic (which is also gated by `isNotEmpty`). Consider 
either (1) rejecting empty/blank values during validation, or (2) treating 
empty/blank as an explicit "unset" that sets `cloudCluster` to null and updates 
the offset provider accordingly, and ensure non-cloud mode rejects the property 
whenever the key is specified (even if blank).
   ```suggestion
           boolean hasComputeGroup = 
inputProperties.containsKey(DataSourceConfigKeys.COMPUTE_GROUP);
           String newGroup = inputStreamProps.getComputeGroup();
           if (hasComputeGroup) {
               if (!Config.isCloudMode()) {
                   throw new AnalysisException("compute_group property is only 
supported in cloud mode");
               }
               if (StringUtils.isBlank(newGroup)) {
                   this.cloudCluster = null;
               } else {
                   this.cloudCluster = newGroup;
               }
               pushCloudClusterToOffsetProvider();
           }
           this.properties.putAll(inputProperties);
           if (hasComputeGroup && StringUtils.isBlank(newGroup)) {
               this.properties.remove(DataSourceConfigKeys.COMPUTE_GROUP);
           }
   ```



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