br 工具疑问2

    // number of retries to make of operations.
    maxRetries = 7
    // max number of retries when meets error
    maxErrorRetries = 3

  func defaultS3Retryer() request.Retryer {
    return retryerWithLog{
            DefaultRetryer: client.DefaultRetryer{
                    NumMaxRetries:    maxRetries,
                    MinRetryDelay:    1 * time.Second,
                    MinThrottleDelay: 2 * time.Second,
            },
    }

}

https://github.com/pingcap/tidb/blob/3b508b3a20d05bdfd56c38f4ed9b0dc07e7dc19b/br/pkg/storage/s3.go#L796

看代码关于重试,有两个写死的变量: maxRetries 是s3的client的NumMaxRetries参数
maxErrorRetries 是读取遇到错误的重试次数。好像没有对外提供参配置。

1 个赞