You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "rajagopr (via GitHub)" <gi...@apache.org> on 2025/04/25 02:19:20 UTC

[PR] Added timeouts to the resource deletion calls from SegmentDeletionManager [pinot]

rajagopr opened a new pull request, #15638:
URL: https://github.com/apache/pinot/pull/15638

   ## Description
   Added a timeout wrapper to object deletion calls issued from the SegmentDeletionManager. Occasionally, we are running into stuck deletion calls while deleting objects from GCS. This timeout wrapper should help. This is causing the RetentionManager to be stuck forever.
   
   **Error Details**
   ```
           at sun.nio.ch.NioSocketImpl.implRead(java.base@21.0.6/NioSocketImpl.java:304)
           at sun.nio.ch.NioSocketImpl.read(java.base@21.0.6/NioSocketImpl.java:346)
           at sun.nio.ch.NioSocketImpl$1.read(java.base@21.0.6/NioSocketImpl.java:796)
           at java.net.Socket$SocketInputStream.read(java.base@21.0.6/Socket.java:1099)
           at sun.security.ssl.SSLSocketInputRecord.read(java.base@21.0.6/SSLSocketInputRecord.java:489)
           at sun.security.ssl.SSLSocketInputRecord.readHeader(java.base@21.0.6/SSLSocketInputRecord.java:483)
           at sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(java.base@21.0.6/SSLSocketInputRecord.java:70)
           at sun.security.ssl.SSLSocketImpl.readApplicationRecord(java.base@21.0.6/SSLSocketImpl.java:1461)
           at sun.security.ssl.SSLSocketImpl$AppInputStream.read(java.base@21.0.6/SSLSocketImpl.java:1066)
           at java.io.BufferedInputStream.fill(java.base@21.0.6/BufferedInputStream.java:291)
           at java.io.BufferedInputStream.read1(java.base@21.0.6/BufferedInputStream.java:347)
           at java.io.BufferedInputStream.implRead(java.base@21.0.6/BufferedInputStream.java:420)
           at java.io.BufferedInputStream.read(java.base@21.0.6/BufferedInputStream.java:399)
           at sun.net.www.http.HttpClient.parseHTTPHeader(java.base@21.0.6/HttpClient.java:827)
           at sun.net.www.http.HttpClient.parseHTTP(java.base@21.0.6/HttpClient.java:759)
           at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(java.base@21.0.6/HttpURLConnection.java:1705)
           at sun.net.www.protocol.http.HttpURLConnection.getInputStream(java.base@21.0.6/HttpURLConnection.java:1614)
           at java.net.HttpURLConnection.getResponseCode(java.base@21.0.6/HttpURLConnection.java:531)
           at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(java.base@21.0.6/HttpsURLConnectionImpl.java:307)
           at com.google.api.client.http.javanet.NetHttpResponse.<init>(NetHttpResponse.java:36)
           at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:152)
           at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:84)
           at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1012)
           at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:565)
           at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:506)
           at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:616)
           at com.google.cloud.storage.spi.v1.HttpStorageRpc.delete(HttpStorageRpc.java:740)
           at com.google.cloud.storage.StorageImpl.lambda$delete$21(StorageImpl.java:627)
           at com.google.cloud.storage.StorageImpl$$Lambda/0x00007eeb32dbc880.call(Unknown Source)
           at com.google.api.gax.retrying.DirectRetryingExecutor.submit(DirectRetryingExecutor.java:102)
           at com.google.cloud.RetryHelper.run(RetryHelper.java:76)
           at com.google.cloud.RetryHelper.runWithRetries(RetryHelper.java:50)
           at com.google.cloud.storage.Retrying.run(Retrying.java:65)
           at com.google.cloud.storage.StorageImpl.run(StorageImpl.java:1611)
           at com.google.cloud.storage.StorageImpl.delete(StorageImpl.java:627)
           at com.google.cloud.storage.Blob.delete(Blob.java:881)
           at org.apache.pinot.plugin.filesystem.GcsPinotFS.delete(GcsPinotFS.java:414)
           at org.apache.pinot.plugin.filesystem.GcsPinotFS.delete(GcsPinotFS.java:134)
           at org.apache.pinot.spi.filesystem.NoClosePinotFS.delete(NoClosePinotFS.java:50)
           at org.apache.pinot.controller.helix.core.SegmentDeletionManager.removeAgedDeletedSegments(SegmentDeletionManager.java:375)
           at org.apache.pinot.controller.helix.core.retention.RetentionManager.postprocess(RetentionManager.java:92)
   ```


-- 
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-unsubscribe@pinot.apache.org

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


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


Re: [PR] Added timeouts to the resource deletion calls from SegmentDeletionManager [pinot]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #15638:
URL: https://github.com/apache/pinot/pull/15638#issuecomment-2829270547

   ## [Codecov](https://app.codecov.io/gh/apache/pinot/pull/15638?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   All modified and coverable lines are covered by tests :white_check_mark:
   > Project coverage is 55.71%. Comparing base [(`f99e9fb`)](https://app.codecov.io/gh/apache/pinot/commit/f99e9fbb71f1764426bc7ec55b09eb545769696f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`86d61a2`)](https://app.codecov.io/gh/apache/pinot/commit/86d61a238c52c69c0c06ab26019a0402adc73315?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   > Report is 2 commits behind head on master.
   
   > :exclamation:  There is a different number of reports uploaded between BASE (f99e9fb) and HEAD (86d61a2). Click for more details.
   > 
   > <details><summary>HEAD has 62 uploads less than BASE</summary>
   >
   >| Flag | BASE (f99e9fb) | HEAD (86d61a2) |
   >|------|------|------|
   >|unittests|6|2|
   >|unittests1|3|2|
   >|java-21|10|2|
   >|skip-bytebuffers-false|8|1|
   >|temurin|15|2|
   >|unittests2|3|0|
   >|skip-bytebuffers-true|4|1|
   >|java-11|5|0|
   >|integration|9|0|
   >|integration2|3|0|
   >|integration1|3|0|
   >|custom-integration1|3|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #15638      +/-   ##
   ============================================
   - Coverage     62.78%   55.71%   -7.08%     
   + Complexity     1382      682     -700     
   ============================================
     Files          2863     2238     -625     
     Lines        162780   121099   -41681     
     Branches      24915    19325    -5590     
   ============================================
   - Hits         102203    67466   -34737     
   + Misses        52871    48090    -4781     
   + Partials       7706     5543    -2163     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/pinot/pull/15638/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [custom-integration1](https://app.codecov.io/gh/apache/pinot/pull/15638/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration](https://app.codecov.io/gh/apache/pinot/pull/15638/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration1](https://app.codecov.io/gh/apache/pinot/pull/15638/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration2](https://app.codecov.io/gh/apache/pinot/pull/15638/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [java-11](https://app.codecov.io/gh/apache/pinot/pull/15638/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [java-21](https://app.codecov.io/gh/apache/pinot/pull/15638/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.71% <ø> (-7.07%)` | :arrow_down: |
   | [skip-bytebuffers-false](https://app.codecov.io/gh/apache/pinot/pull/15638/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.69% <ø> (-7.09%)` | :arrow_down: |
   | [skip-bytebuffers-true](https://app.codecov.io/gh/apache/pinot/pull/15638/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.65% <ø> (-7.08%)` | :arrow_down: |
   | [temurin](https://app.codecov.io/gh/apache/pinot/pull/15638/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.71% <ø> (-7.08%)` | :arrow_down: |
   | [unittests](https://app.codecov.io/gh/apache/pinot/pull/15638/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.71% <ø> (-7.08%)` | :arrow_down: |
   | [unittests1](https://app.codecov.io/gh/apache/pinot/pull/15638/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.71% <ø> (-0.03%)` | :arrow_down: |
   | [unittests2](https://app.codecov.io/gh/apache/pinot/pull/15638/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/pinot/pull/15638?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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-unsubscribe@pinot.apache.org

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


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


Re: [PR] Added timeouts to the resource deletion calls from SegmentDeletionManager [pinot]

Posted by "rajagopr (via GitHub)" <gi...@apache.org>.
rajagopr commented on code in PR #15638:
URL: https://github.com/apache/pinot/pull/15638#discussion_r2060539580


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/SegmentDeletionManager.java:
##########
@@ -459,6 +466,32 @@ public void removeAgedDeletedSegments(LeadControllerManager leadControllerManage
     }
   }
 
+  private static boolean deleteWithTimeout(PinotFS pinotFS, URI targetURI, boolean forceDelete, long timeout,
+      TimeUnit timeUnit) {
+    CompletableFuture<Boolean> deleteFuture = CompletableFuture.supplyAsync(() -> {

Review Comment:
   +1. We should inspect how the clients are built and add timeouts to the individual clients itself. All SDKs provide mechanism to pass timeouts and retry strategies among others. This should be seen as a quick-fix without causing regression.



-- 
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-unsubscribe@pinot.apache.org

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


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


Re: [PR] Added timeouts to the resource deletion calls from SegmentDeletionManager [pinot]

Posted by "rajagopr (via GitHub)" <gi...@apache.org>.
rajagopr commented on code in PR #15638:
URL: https://github.com/apache/pinot/pull/15638#discussion_r2060548021


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/SegmentDeletionManager.java:
##########
@@ -459,6 +466,32 @@ public void removeAgedDeletedSegments(LeadControllerManager leadControllerManage
     }
   }
 
+  private static boolean deleteWithTimeout(PinotFS pinotFS, URI targetURI, boolean forceDelete, long timeout,

Review Comment:
   The stack trace shows that retries are built-in to the sdk itself.
   
   ```
           at com.google.api.gax.retrying.DirectRetryingExecutor.submit(DirectRetryingExecutor.java:102)
           at com.google.cloud.RetryHelper.run(RetryHelper.java:76)
           at com.google.cloud.RetryHelper.runWithRetries(RetryHelper.java:50)
           at com.google.cloud.storage.Retrying.run(Retrying.java:65)
           at com.google.cloud.storage.StorageImpl.run(StorageImpl.java:1611)
           at com.google.cloud.storage.StorageImpl.delete(StorageImpl.java:627)
           at com.google.cloud.storage.Blob.delete(Blob.java:881)
   ```
   



-- 
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-unsubscribe@pinot.apache.org

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


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


Re: [PR] Added timeouts to the resource deletion calls from SegmentDeletionManager [pinot]

Posted by "swaminathanmanish (via GitHub)" <gi...@apache.org>.
swaminathanmanish commented on code in PR #15638:
URL: https://github.com/apache/pinot/pull/15638#discussion_r2060482197


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/SegmentDeletionManager.java:
##########
@@ -459,6 +466,32 @@ public void removeAgedDeletedSegments(LeadControllerManager leadControllerManage
     }
   }
 
+  private static boolean deleteWithTimeout(PinotFS pinotFS, URI targetURI, boolean forceDelete, long timeout,

Review Comment:
   Does it make sense to add retries or we would anyway come back to file again in the next run. 



##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/SegmentDeletionManager.java:
##########
@@ -459,6 +466,32 @@ public void removeAgedDeletedSegments(LeadControllerManager leadControllerManage
     }
   }
 
+  private static boolean deleteWithTimeout(PinotFS pinotFS, URI targetURI, boolean forceDelete, long timeout,
+      TimeUnit timeUnit) {
+    CompletableFuture<Boolean> deleteFuture = CompletableFuture.supplyAsync(() -> {

Review Comment:
   Eventually this should be in pinotFS itself. I guess we need delegator/composition pattern, where we have resilientPinotFs or something that delegates calls to underlying pinotFs but wraps around the calls with timeout/retries. Alternatively every implementation wraps around its calls from a shared timeout & retry wrapper utility. 
   



-- 
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-unsubscribe@pinot.apache.org

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


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


Re: [PR] Added timeouts to the resource deletion calls from SegmentDeletionManager [pinot]

Posted by "swaminathanmanish (via GitHub)" <gi...@apache.org>.
swaminathanmanish merged PR #15638:
URL: https://github.com/apache/pinot/pull/15638


-- 
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-unsubscribe@pinot.apache.org

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


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