mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
vmbackup: configure retries for GCS remote FS (#3156)
This commit is contained in:
parent
1bac96dfce
commit
f022296d96
1 changed files with 10 additions and 0 deletions
|
@ -5,11 +5,13 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"cloud.google.com/go/storage"
|
"cloud.google.com/go/storage"
|
||||||
"github.com/VictoriaMetrics/VictoriaMetrics/lib/backup/common"
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/backup/common"
|
||||||
"github.com/VictoriaMetrics/VictoriaMetrics/lib/backup/fscommon"
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/backup/fscommon"
|
||||||
"github.com/VictoriaMetrics/VictoriaMetrics/lib/logger"
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/logger"
|
||||||
|
"github.com/googleapis/gax-go/v2"
|
||||||
"google.golang.org/api/iterator"
|
"google.golang.org/api/iterator"
|
||||||
"google.golang.org/api/option"
|
"google.golang.org/api/option"
|
||||||
)
|
)
|
||||||
|
@ -61,6 +63,14 @@ func (fs *FS) Init() error {
|
||||||
}
|
}
|
||||||
client = c
|
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)
|
fs.bkt = client.Bucket(fs.Bucket)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue