jtao15 commented on a change in pull request #7427:
URL: https://github.com/apache/pinot/pull/7427#discussion_r715162346



##########
File path: 
pinot-controller/src/main/java/org/apache/pinot/controller/api/upload/ZKOperator.java
##########
@@ -65,7 +65,14 @@ public void completeSegmentOperations(String 
tableNameWithType, SegmentMetadata
     String segmentName = segmentMetadata.getName();
     ZNRecord segmentMetadataZNRecord =
         
_pinotHelixResourceManager.getSegmentMetadataZnRecord(tableNameWithType, 
segmentName);
+    boolean refreshOnly =
+        
Boolean.parseBoolean(headers.getHeaderString(FileUploadDownloadClient.CustomHeaders.REFRESH_ONLY));
     if (segmentMetadataZNRecord == null) {
+      if (refreshOnly) {
+        throw new ControllerApplicationException(LOGGER,
+            "Cannot refresh non-existing segment, aborted uploading segment: " 
+ segmentName + " of table: "
+                + tableNameWithType, Response.Status.GONE);

Review comment:
       Good point, added the api response code in api description.




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