9aman commented on code in PR #15299: URL: https://github.com/apache/pinot/pull/15299#discussion_r2016336731
########## pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentRestletResource.java: ########## @@ -1175,6 +1179,136 @@ public SuccessResponse updateTimeIntervalZK( return updateZKTimeIntervalInternal(tableNameWithType); } + @DELETE + @Produces(MediaType.APPLICATION_JSON) + @Path("/deletePauselessSegments/{tableName}") + @Authorize(targetType = TargetType.TABLE, paramName = "tableName", action = Actions.Table.DELETE_SEGMENT) + @Authenticate(AccessType.DELETE) + @ApiOperation(value = "Delete segments from a pauseless enabled table", notes = + "Deletes segments from a pauseless-enabled table based on the provided segment names. " + + "For each segment provided, it identifies the partition and deletes all segments " + + "with sequence numbers >= the provided segment in that partition. " + + "When force flag is true, it bypasses checks for pauseless being enabled and table being paused. " + + "The retention period controls how long deleted segments are retained before permanent removal. " + + "It follows this precedence: input parameter → table config → cluster setting → 7d default. " + + "Use 0d or -1d for immediate deletion without retention.") + public SuccessResponse deletePauselessSegments( + @ApiParam(value = "Name of the table with type", required = true) @PathParam("tableNameWithType") + String tableNameWithType, + @ApiParam(value = "List of segment names. For each segment, all segments with higher sequence IDs in the same " + + "partition will be deleted", required = true, allowMultiple = true) + @QueryParam("segments") List<String> segments, Review Comment: We can add this later. But I feel making the user enter the entire segment name and verifying the same in the code reduces the chances of deleiton. The above approach exposes the table to a potential loss of data. -- 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