aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNumblgw <44025291+Numblgw@users.noreply.github.com>2025-02-18 07:46:31 +0800
committerGitHub <noreply@github.com>2025-02-17 15:46:31 -0800
commitc2b894276992e8b3a879945d3eb9ff303fe47c74 (patch)
treeff3f75cbe5fae0581600e4bec077e682e4b5e459
parent441614b38665f3831c4f91d10a21e6d4d4f52391 (diff)
downloadseaweedfs-c2b894276992e8b3a879945d3eb9ff303fe47c74.tar.xz
seaweedfs-c2b894276992e8b3a879945d3eb9ff303fe47c74.zip
stop retry when all nodes have tried it (#6551)
Co-authored-by: liguowei <liguowei@xinye.com>
-rw-r--r--weed/filer/filechunk_manifest.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/weed/filer/filechunk_manifest.go b/weed/filer/filechunk_manifest.go
index e9ae1800c..36096d2c1 100644
--- a/weed/filer/filechunk_manifest.go
+++ b/weed/filer/filechunk_manifest.go
@@ -130,7 +130,9 @@ func retriedStreamFetchChunkData(writer io.Writer, urlStrings []string, jwt stri
var totalWritten int
for waitTime := time.Second; waitTime < util.RetryWaitTime; waitTime += waitTime / 2 {
+ retriedCnt := 0
for _, urlString := range urlStrings {
+ retriedCnt++
var localProcessed int
var writeErr error
shouldRetry, err = util_http.ReadUrlAsStreamAuthenticated(urlString+"?readDeleted=true", jwt, cipherKey, isGzipped, isFullChunk, offset, size, func(data []byte) {
@@ -161,6 +163,10 @@ func retriedStreamFetchChunkData(writer io.Writer, urlStrings []string, jwt stri
break
}
}
+ // all nodes have tried it
+ if retriedCnt == len(urlStrings) {
+ break
+ }
if err != nil && shouldRetry {
glog.V(0).Infof("retry reading in %v", waitTime)
time.Sleep(waitTime)