Jackie-Jiang commented on code in PR #16310:
URL: https://github.com/apache/pinot/pull/16310#discussion_r2216888250
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentUploadDownloadRestletResource.java:
##########
@@ -1022,6 +1025,9 @@ public Response endReplaceSegments(
Preconditions.checkNotNull(segmentLineageEntryId,
"'segmentLineageEntryId' should not be null");
_pinotHelixResourceManager.endReplaceSegments(tableNameWithType,
segmentLineageEntryId,
endReplaceSegmentsRequest);
+ if (pruneSegments) {
+
_pinotHelixResourceManager.invokeControllerPeriodicTask(tableNameWithType,
RetentionManager.TASK_NAME, null);
Review Comment:
Invoking retention manager is too expensive and will touch all tables. We
should pass this parameter into
`_pinotHelixResourceManager.endReplicaSegments()` call and only delete the
segments replaced for this table
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentUploadDownloadRestletResource.java:
##########
@@ -1022,6 +1025,9 @@ public Response endReplaceSegments(
Preconditions.checkNotNull(segmentLineageEntryId,
"'segmentLineageEntryId' should not be null");
_pinotHelixResourceManager.endReplaceSegments(tableNameWithType,
segmentLineageEntryId,
endReplaceSegmentsRequest);
+ if (pruneSegments) {
+
_pinotHelixResourceManager.invokeControllerPeriodicTask(tableNameWithType,
RetentionManager.TASK_NAME, null);
Review Comment:
Not introduced in this PR, but we didn't check the return value of
`_pinotHelixResourceManager.endReplicaSegments()`
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentUploadDownloadRestletResource.java:
##########
@@ -1007,6 +1008,8 @@ public Response endReplaceSegments(
@ApiParam(value = "OFFLINE|REALTIME", required = true)
@QueryParam("type") String tableTypeStr,
@ApiParam(value = "Segment lineage entry id returned by
startReplaceSegments API", required = true)
@QueryParam("segmentLineageEntryId") String segmentLineageEntryId,
+ @ApiParam(value = "Trigger an immediate segment prune")
@QueryParam("prune") @DefaultValue("false")
Review Comment:
I wouldn't call it `prune`. I feel `cleanup` might be a better name
--
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]