tibrewalpratik17 commented on code in PR #12317:
URL: https://github.com/apache/pinot/pull/12317#discussion_r1475797609


##########
pinot-common/src/main/java/org/apache/pinot/common/utils/fetcher/BaseSegmentFetcher.java:
##########
@@ -109,6 +112,38 @@ public File fetchUntarSegmentToLocalStreamed(URI uri, File 
dest, long rateLimit,
     throw new UnsupportedOperationException();
   }
 
+  // Download segment to a local location with retries.
+  @Override
+  public boolean fetchSegmentToLocal(String segmentName, File dest, 
HelixManager helixManager, String downloadScheme)
+      throws Exception {
+    try {
+      int attempt =
+          RetryPolicies.exponentialBackoffRetryPolicy(_retryCount, 
_retryWaitMs, _retryDelayScaleFactor).attempt(() -> {
+            // First find servers hosting the segment in ONLINE state.
+            List<URI> peerSegmentURIs =
+                PeerServerSegmentFinder.getPeerServerURIs(segmentName, 
downloadScheme, helixManager);
+            // Shuffle the list of URIs.
+            Collections.shuffle(peerSegmentURIs);
+            // Next get through the list of URIs to fetch the segment until 
success.
+            for (URI uri : peerSegmentURIs) {
+              try {
+                fetchSegmentToLocalWithoutRetry(uri, dest);

Review Comment:
   This will increase this function retry count from present 3 (retry_count) to 
`3 * number of peer servers`. Is that desired?



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

Reply via email to