-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dumpling will not retry upload to GCS if the server returned 503 #56127
Comments
The reason GCS did not retry is because the upload is not considered an "idempotent operation". The default retry policy is RetryIdempotent, which said:
Patching the GCS to use diff --git a/br/pkg/storage/gcs.go b/br/pkg/storage/gcs.go
index 0f1d8a2418..b4893657ba 100644
--- a/br/pkg/storage/gcs.go
+++ b/br/pkg/storage/gcs.go
@@ -432,7 +432,7 @@ func (s *GCSStorage) Reset(ctx context.Context) error {
if err != nil {
return errors.Trace(err)
}
- client.SetRetry(storage.WithErrorFunc(shouldRetry))
+ client.SetRetry(storage.WithErrorFunc(shouldRetry), storage.WithPolicy(storage.RetryAlways))
s.clients[i] = client
return nil
}) but I'm not sure if we should use this easy solution which "can lead to race conditions and other conflicts", or properly making it idempotent by supplying the |
@Benjamin2037 will your team fix the problem? |
@BornChanger OK |
I can take a look at this, but please let me know if it is urgent. |
@OliverS929 We have asked customer tried using the XML API ( |
The customer used local disks as a workaround. But as it's such a common scenario on GCP, it would also be helpful if this could be fixed. |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
(I used mitmproxy to inject the 503 error. For testing there should be some zero-external-dependency means to do so 🤔 Also I used a local fake-gcs-server serving HTTP to avoid distractions of installing the self-signed TLS CA.)
Get mitmproxy
Prepare the following script, which will inject 503 for the first two requests to
*/o
(the URL for uploading objects to GCS)Run mitmproxy loaded with this script
Patch dumpling to use this proxy:
Run dumpling.
2. What did you expect to see? (Required)
Given that we only inject 503 twice, Dumpling should be able to successfully upload the file on its 3rd try and the whole process succeed.
Inside the mitmproxy console, we should be able to see two 503 responses like
3. What did you see instead (Required)
Dumpling failed without any retry, with logs like
4. What is your TiDB version? (Required)
Dumpling v8.3.0
The text was updated successfully, but these errors were encountered: