You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "heatclub (via GitHub)" <gi...@apache.org> on 2023/03/12 07:51:00 UTC

[GitHub] [pinot] heatclub opened a new pull request, #10411: * Retry failures in untar

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

   * Configs for untar retries
   * Metric for untar retries added
   
   Instructions:
   1. The PR has to be tagged with at least one of the following labels (*):
      1. `feature`
      2. `bugfix`
      3. `performance`
      4. `ui`
      5. `backward-incompat`
      6. `release-notes` (**)
   2. Remove these instructions before publishing the PR.
    
   (*) Other labels to consider:
   - `testing`
   - `dependencies`
   - `docker`
   - `kubernetes`
   - `observability`
   - `security`
   - `code-style`
   - `extension-point`
   - `refactor`
   - `cleanup`
   
   (**) Use `release-notes` label for scenarios like:
   - New configuration options
   - Deprecation of configurations
   - Signature changes to public methods/interfaces
   - New plugins added or old plugins removed
   


-- 
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


[GitHub] [pinot] codecov-commenter commented on pull request #10411: Retry segment untar failures

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

   ## [Codecov](https://codecov.io/gh/apache/pinot/pull/10411?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#10411](https://codecov.io/gh/apache/pinot/pull/10411?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ee1840f) into [master](https://codecov.io/gh/apache/pinot/commit/3bad67db074aa7900ad811a7dd1fcaa5731afeb9?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3bad67d) will **decrease** coverage by `56.49%`.
   > The diff coverage is `0.00%`.
   
   ```diff
   @@              Coverage Diff              @@
   ##             master   #10411       +/-   ##
   =============================================
   - Coverage     70.32%   13.83%   -56.49%     
   + Complexity     6105      259     -5846     
   =============================================
     Files          2055     1999       -56     
     Lines        111389   108995     -2394     
     Branches      16939    16648      -291     
   =============================================
   - Hits          78337    15083    -63254     
   - Misses        27566    92691    +65125     
   + Partials       5486     1221     -4265     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | integration1 | `?` | |
   | integration2 | `?` | |
   | unittests1 | `?` | |
   | unittests2 | `13.83% <0.00%> (-0.03%)` | :arrow_down: |
   
   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=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/pinot/pull/10411?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...a/org/apache/pinot/common/metrics/ServerMeter.java](https://codecov.io/gh/apache/pinot/pull/10411?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vbWV0cmljcy9TZXJ2ZXJNZXRlci5qYXZh) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [.../pinot/core/data/manager/BaseTableDataManager.java](https://codecov.io/gh/apache/pinot/pull/10411?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9kYXRhL21hbmFnZXIvQmFzZVRhYmxlRGF0YU1hbmFnZXIuamF2YQ==) | `0.00% <0.00%> (-75.60%)` | :arrow_down: |
   | [...ent/local/data/manager/TableDataManagerParams.java](https://codecov.io/gh/apache/pinot/pull/10411?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3Qtc2VnbWVudC1sb2NhbC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3Qvc2VnbWVudC9sb2NhbC9kYXRhL21hbmFnZXIvVGFibGVEYXRhTWFuYWdlclBhcmFtcy5qYXZh) | `0.00% <0.00%> (-70.00%)` | :arrow_down: |
   
   ... and [1613 files with indirect coverage changes](https://codecov.io/gh/apache/pinot/pull/10411/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
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


[GitHub] [pinot] heatclub commented on a diff in pull request #10411: Retry segment untar failures

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


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java:
##########
@@ -526,6 +538,9 @@ private File downloadSegmentFromDeepStore(String segmentName, SegmentZKMetadata
     } else {
       try {
         File tarFile = downloadAndDecrypt(segmentName, zkMetadata, tempRootDir);
+        if (_isRetrySegmentDownloadUntarFailure) {

Review Comment:
   Apart from retry changes in this PR, `downloadSegmentFromDeepStore()` has only one other flow `downloadAndStreamUntarWithRateLimit()` in which a retry logic is already present for that path in `HttpSegmentfetcher.fetchUntarSegmentToLocalStreamed()` for download failure only. Should we handle untar failures also there itself ? As both download and untar happens in that same function 
   
   The advantage of: `retry logic over the downloadSegmentFromDeepStore()` is that it required less code changes.
   Your thoughts around this ?
   



-- 
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


[GitHub] [pinot] heatclub commented on a diff in pull request #10411: Retry segment untar failures

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


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java:
##########
@@ -526,6 +538,9 @@ private File downloadSegmentFromDeepStore(String segmentName, SegmentZKMetadata
     } else {
       try {
         File tarFile = downloadAndDecrypt(segmentName, zkMetadata, tempRootDir);
+        if (_isRetrySegmentDownloadUntarFailure) {

Review Comment:
   Apart from retry changes in this PR, `downloadSegmentFromDeepStore()` has only one other flow `downloadAndStreamUntarWithRateLimit()` in which a retry logic is already present for that path in `HttpSegmentfetcher.fetchUntarSegmentToLocalStreamed()` for download failure only. Should we handle untar failures also there itself ? As both download and untar happens in that same function 
   
   Te advantage of: `retry logic over the downloadSegmentFromDeepStore()` is that it required less code changes.



-- 
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


[GitHub] [pinot] heatclub commented on a diff in pull request #10411: Retry segment untar failures

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


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/data/manager/TableDataManagerParams.java:
##########
@@ -56,6 +76,38 @@ public void setStreamSegmentDownloadUntarRateLimitBytesPerSec(long streamSegment
     _streamSegmentDownloadUntarRateLimitBytesPerSec = streamSegmentDownloadUntarRateLimitBytesPerSec;
   }
 
+  public boolean isRetrySegmentDownloadUntarFailure() {
+    return _isRetrySegmentDownloadUntarFailure;
+  }
+
+  public void setRetrySegmentDownloadUntarFailure(boolean retrySegmentDownloadUntarFailure) {
+    _isRetrySegmentDownloadUntarFailure = retrySegmentDownloadUntarFailure;
+  }
+
+  public int getRetryCount() {

Review Comment:
   These variables have been renamed now



-- 
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


[GitHub] [pinot] heatclub commented on a diff in pull request #10411: Retry segment untar failures

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


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java:
##########
@@ -644,12 +659,13 @@ private File downloadAndStreamUntarWithRateLimit(String segmentName, SegmentZKMe
   }
 
   @VisibleForTesting
-  File untarAndMoveSegment(String segmentName, File tarFile, File tempRootDir)
+  protected File untarAndMoveSegment(String segmentName, File tarFile, File tempRootDir)
       throws IOException {
     File untarDir = new File(tempRootDir, segmentName);
     try {
       // If an exception is thrown when untarring, it means the tar file is broken
       // or not found after the retry. Thus, there's no need to retry again.
+      // unless untar retry is configured, which will retry this function call

Review Comment:
   That is the premise of this issue: https://github.com/apache/pinot/issues/9152 for which this PR is raised.
   In case of partial/corrupted tar downloads the untar fails, so the download and untar is retried.
   This function is externally retried, so should I remove this comment ?



-- 
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] Retry segment untar failures [pinot]

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

   Closing this PR as stale because it has had no activity for more than one year (last updated before 2025-06-18). If this is still relevant, please reopen it or open a fresh PR against current master. Thanks for the contribution.


-- 
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


[GitHub] [pinot] gortiz commented on a diff in pull request #10411: Retry segment untar failures

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


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java:
##########
@@ -644,12 +659,13 @@ private File downloadAndStreamUntarWithRateLimit(String segmentName, SegmentZKMe
   }
 
   @VisibleForTesting
-  File untarAndMoveSegment(String segmentName, File tarFile, File tempRootDir)
+  protected File untarAndMoveSegment(String segmentName, File tarFile, File tempRootDir)
       throws IOException {
     File untarDir = new File(tempRootDir, segmentName);
     try {
       // If an exception is thrown when untarring, it means the tar file is broken
       // or not found after the retry. Thus, there's no need to retry again.
+      // unless untar retry is configured, which will retry this function call

Review Comment:
   The original description says that there is no need to retry, implying that if it fails once, retries will also fail. In which cases a retry will be useful?



-- 
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


[GitHub] [pinot] jasperjiaguo commented on a diff in pull request #10411: Retry segment untar failures

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


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java:
##########
@@ -526,6 +538,9 @@ private File downloadSegmentFromDeepStore(String segmentName, SegmentZKMetadata
     } else {
       try {
         File tarFile = downloadAndDecrypt(segmentName, zkMetadata, tempRootDir);
+        if (_isRetrySegmentDownloadUntarFailure) {

Review Comment:
   +1. I also think `downloadAndDecryptUntar` would be cleaner



-- 
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


[GitHub] [pinot] heatclub commented on a diff in pull request #10411: [Draft] Retry segment untar failures

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


##########
pinot-server/src/main/java/org/apache/pinot/server/starter/helix/HelixInstanceDataManagerConfig.java:
##########
@@ -29,6 +29,8 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.apache.pinot.common.utils.fetcher.BaseSegmentFetcher.*;

Review Comment:
   These imports cause check-style failures flagging static imports.
   Should these variables be recreated here ?



-- 
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


[GitHub] [pinot] heatclub commented on a diff in pull request #10411: Retry segment untar failures

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


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java:
##########
@@ -667,6 +683,36 @@ File untarAndMoveSegment(String segmentName, File tarFile, File tempRootDir)
     }
   }
 
+  @VisibleForTesting
+  File untarAndMoveSegmentWithRetries(String segmentName, File tarFile, File tempRootDir, SegmentZKMetadata zkMetadata)
+      throws AttemptsExceededException {
+    AtomicReference<File> file = new AtomicReference<>();
+    try {
+      file.set(untarAndMoveSegment(segmentName, tarFile, tempRootDir));
+    } catch (Exception e) {
+      try {
+        RetryPolicies.exponentialBackoffRetryPolicy(_retryCount, _retryWaitMs, _retryDelayScaleFactor).attempt(() -> {
+          try {
+            File retriedTarFile = downloadAndDecrypt(segmentName, zkMetadata, tempRootDir);

Review Comment:
   Thanks, that is a valid observation.
   I am now deleting the retriedTarFile in finally block.



-- 
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] Retry segment untar failures [pinot]

Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 closed pull request #10411: Retry segment untar failures
URL: https://github.com/apache/pinot/pull/10411


-- 
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


[GitHub] [pinot] heatclub commented on a diff in pull request #10411: Retry segment untar failures

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


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java:
##########
@@ -526,6 +538,9 @@ private File downloadSegmentFromDeepStore(String segmentName, SegmentZKMetadata
     } else {
       try {
         File tarFile = downloadAndDecrypt(segmentName, zkMetadata, tempRootDir);
+        if (_isRetrySegmentDownloadUntarFailure) {

Review Comment:
   Apart from retry changes in this PR, `downloadSegmentFromDeepStore()` has only one other flow `downloadAndStreamUntarWithRateLimit()` in which a retry logic is already present for that path in `HttpSegmentfetcher.fetchUntarSegmentToLocalStreamed()` for download failure only: https://github.com/apache/pinot/blob/master/pinot-common/src/main/java/org/apache/pinot/common/utils/fetcher/HttpSegmentFetcher.java#L108
   Should we handle untar failures also there itself ? As both download and untar happens in that same function for streamed untar with rate limit
   
   The advantage of: `retry logic over the downloadSegmentFromDeepStore()` is that it required less code changes.
   Your thoughts around this ?
   



-- 
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


[GitHub] [pinot] Jackie-Jiang commented on a diff in pull request #10411: Retry segment untar failures

Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang commented on code in PR #10411:
URL: https://github.com/apache/pinot/pull/10411#discussion_r1137826666


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java:
##########
@@ -526,6 +538,9 @@ private File downloadSegmentFromDeepStore(String segmentName, SegmentZKMetadata
     } else {
       try {
         File tarFile = downloadAndDecrypt(segmentName, zkMetadata, tempRootDir);
+        if (_isRetrySegmentDownloadUntarFailure) {

Review Comment:
   The same retry logic also exists in `downloadAndDecrypt()`. I feel the clean fix should be change the `downloadAndDecrypt()` to `downloadAndDecryptUntar()` which also untar the segment similar to `downloadAndStreamUntarWithRateLimit()`. We already have the configurable retries within the `SegmentFetcher`, and IMO we don't want another set of configs to control the retry for untar.
   cc @jasperjiaguo 



-- 
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


[GitHub] [pinot] heatclub commented on a diff in pull request #10411: Retry segment untar failures

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


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java:
##########
@@ -526,6 +538,9 @@ private File downloadSegmentFromDeepStore(String segmentName, SegmentZKMetadata
     } else {
       try {
         File tarFile = downloadAndDecrypt(segmentName, zkMetadata, tempRootDir);
+        if (_isRetrySegmentDownloadUntarFailure) {

Review Comment:
   Agree on this, let me refactor and update the PR.



-- 
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


[GitHub] [pinot] heatclub commented on a diff in pull request #10411: Retry segment untar failures

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


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java:
##########
@@ -526,6 +538,9 @@ private File downloadSegmentFromDeepStore(String segmentName, SegmentZKMetadata
     } else {
       try {
         File tarFile = downloadAndDecrypt(segmentName, zkMetadata, tempRootDir);
+        if (_isRetrySegmentDownloadUntarFailure) {

Review Comment:
   Apart from retry changes in this PR, downloadSegmentFromDeepStore() has only one other flow downloadAndStreamUntarWithRateLimit() in which a retry logic is already present for that path in HttpSegmentfetcher.fetchUntarSegmentToLocalStreamed() for download failure only. Should we handle untar failures also there itself ? As both download and untar happens in that same function 
   
   Te advantage of: `retry logic over the downloadSegmentFromDeepStore()` is that it required less code changes.



-- 
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


[GitHub] [pinot] Jackie-Jiang commented on a diff in pull request #10411: Retry segment untar failures

Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang commented on code in PR #10411:
URL: https://github.com/apache/pinot/pull/10411#discussion_r1134495502


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java:
##########
@@ -526,6 +538,9 @@ private File downloadSegmentFromDeepStore(String segmentName, SegmentZKMetadata
     } else {
       try {
         File tarFile = downloadAndDecrypt(segmentName, zkMetadata, tempRootDir);
+        if (_isRetrySegmentDownloadUntarFailure) {

Review Comment:
   Here we want to retry on download + untar together. Why not putting the retry logic over the `downloadSegmentFromDeepStore()`?



##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/data/manager/TableDataManagerParams.java:
##########
@@ -56,6 +76,38 @@ public void setStreamSegmentDownloadUntarRateLimitBytesPerSec(long streamSegment
     _streamSegmentDownloadUntarRateLimitBytesPerSec = streamSegmentDownloadUntarRateLimitBytesPerSec;
   }
 
+  public boolean isRetrySegmentDownloadUntarFailure() {
+    return _isRetrySegmentDownloadUntarFailure;
+  }
+
+  public void setRetrySegmentDownloadUntarFailure(boolean retrySegmentDownloadUntarFailure) {
+    _isRetrySegmentDownloadUntarFailure = retrySegmentDownloadUntarFailure;
+  }
+
+  public int getRetryCount() {

Review Comment:
   We need to rename these config keys to be specific for the segment download untar retry



-- 
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


[GitHub] [pinot] zhtaoxiang commented on a diff in pull request #10411: Retry segment untar failures

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


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java:
##########
@@ -667,6 +683,36 @@ File untarAndMoveSegment(String segmentName, File tarFile, File tempRootDir)
     }
   }
 
+  @VisibleForTesting
+  File untarAndMoveSegmentWithRetries(String segmentName, File tarFile, File tempRootDir, SegmentZKMetadata zkMetadata)
+      throws AttemptsExceededException {
+    AtomicReference<File> file = new AtomicReference<>();
+    try {
+      file.set(untarAndMoveSegment(segmentName, tarFile, tempRootDir));
+    } catch (Exception e) {
+      try {
+        RetryPolicies.exponentialBackoffRetryPolicy(_retryCount, _retryWaitMs, _retryDelayScaleFactor).attempt(() -> {
+          try {
+            File retriedTarFile = downloadAndDecrypt(segmentName, zkMetadata, tempRootDir);

Review Comment:
   (not sure if this is needed) Maybe we need to clean up previously downloaded files in order to not use up disk space?



##########
pinot-server/src/main/java/org/apache/pinot/server/starter/helix/HelixInstanceDataManagerConfig.java:
##########
@@ -29,6 +29,8 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.apache.pinot.common.utils.fetcher.BaseSegmentFetcher.*;

Review Comment:
   I think the problem is with the `*`. Maybe you should change your IDE setting and import each explicitly.



-- 
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