Browse Source
stop retry when all nodes have tried it (#6551)
Co-authored-by: liguowei <liguowei@xinye.com>
pull/6557/head
Numblgw
5 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
6 additions and
0 deletions
-
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) |
|
|
|