This is an automated email from the ASF dual-hosted git repository.

pratik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 8bdfb76f12 [Bugfix] delete segment API always deletes consuming 
segments (#14293)
8bdfb76f12 is described below

commit 8bdfb76f12beea389fcde910f8e6875462311452
Author: Pratik Tibrewal <[email protected]>
AuthorDate: Tue Oct 29 13:02:26 2024 +0530

    [Bugfix] delete segment API always deletes consuming segments (#14293)
    
    * [Bugfix] delete segment API always deletes consuming segments
    
    * address comments
---
 .../pinot/controller/helix/core/PinotHelixResourceManager.java       | 5 +++++
 1 file changed, 5 insertions(+)

diff --git 
a/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java
 
b/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java
index 7ce94f04c8..048152fefe 100644
--- 
a/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java
+++ 
b/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java
@@ -946,6 +946,11 @@ public class PinotHelixResourceManager {
     if (segmentMetadata == null) {
       return false;
     }
+    // if endtime is specified, do not return the consuming segment
+    if (endTimestamp != Long.MAX_VALUE
+        && segmentMetadata.getStatus() == 
CommonConstants.Segment.Realtime.Status.IN_PROGRESS) {
+      return false;
+    }
     long startTimeMsInSegment = segmentMetadata.getStartTimeMs();
     long endTimeMsInSegment = segmentMetadata.getEndTimeMs();
     if (startTimeMsInSegment == -1 && endTimeMsInSegment == -1) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to