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



##########
File path: 
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentUploadDownloadRestletResource.java
##########
@@ -298,10 +298,14 @@ private SuccessResponse uploadSegment(@Nullable String 
tableName, TableType tabl
       }
 
       // Zk operations
-      completeZkOperations(enableParallelPushProtection, headers, 
finalSegmentFile, tableNameWithType, segmentMetadata,
-          segmentName, zkDownloadUri, moveSegmentToFinalLocation, 
crypterClassName);
-
-      return new SuccessResponse("Successfully uploaded segment: " + 
segmentName + " of table: " + tableNameWithType);
+      if (completeZkOperations(
+          enableParallelPushProtection, headers, finalSegmentFile, 
tableNameWithType,
+          segmentMetadata, segmentName, zkDownloadUri, 
moveSegmentToFinalLocation, crypterClassName)) {
+        return new SuccessResponse("Successfully uploaded segment: " + 
segmentName + " of table: " + tableNameWithType);
+      } else {
+        return new SuccessResponse("Cannot replace non-existing segment, 
aborted uploading segment: " + segmentName

Review comment:
       Updated to increment the error metric and throw an exception with status 
code 410 (Gone) instead.




-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to