randomize same-dc servers and other-dc servers

This commit is contained in:
Chris Lu
2021-11-12 11:30:11 -08:00
parent 1f75f1f9dc
commit 7bf891c00a
2 changed files with 11 additions and 6 deletions

View File

@@ -6,7 +6,6 @@ import (
"github.com/chrislusf/seaweedfs/weed/wdclient"
"io"
"math"
"math/rand"
"net/url"
"strings"
"time"
@@ -143,9 +142,6 @@ func retriedStreamFetchChunkData(writer io.Writer, urlStrings []string, cipherKe
var shouldRetry bool
var totalWritten int
rand.Shuffle(len(urlStrings), func(i, j int) {
urlStrings[i], urlStrings[j] = urlStrings[j], urlStrings[i]
})
for waitTime := time.Second; waitTime < util.RetryWaitTime; waitTime += waitTime / 2 {
for _, urlString := range urlStrings {
var localProcesed int