From f022296d96874b8bcdc421f16b9c75189091832e Mon Sep 17 00:00:00 2001 From: Zakhar Bessarab Date: Mon, 26 Sep 2022 16:28:20 +0300 Subject: [PATCH] vmbackup: configure retries for GCS remote FS (#3156) --- lib/backup/gcsremote/gcs.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/backup/gcsremote/gcs.go b/lib/backup/gcsremote/gcs.go index 2e28da9f6..8cdf3ca44 100644 --- a/lib/backup/gcsremote/gcs.go +++ b/lib/backup/gcsremote/gcs.go @@ -5,11 +5,13 @@ import ( "fmt" "io" "strings" + "time" "cloud.google.com/go/storage" "github.com/VictoriaMetrics/VictoriaMetrics/lib/backup/common" "github.com/VictoriaMetrics/VictoriaMetrics/lib/backup/fscommon" "github.com/VictoriaMetrics/VictoriaMetrics/lib/logger" + "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" ) @@ -61,6 +63,14 @@ func (fs *FS) Init() error { } client = c } + + client.SetRetry( + storage.WithPolicy(storage.RetryAlways), + storage.WithBackoff(gax.Backoff{ + Initial: time.Second, + Max: time.Minute * 3, + Multiplier: 3, + })) fs.bkt = client.Bucket(fs.Bucket) return nil }