Skip to content
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re
- [#116](https://github.com/thanos-io/objstore/pull/116) Azure: Add new storage_create_container configuration property
- [#128](https://github.com/thanos-io/objstore/pull/128) GCS: Add support for `ChunkSize` for writer.
- [#130](https://github.com/thanos-io/objstore/pull/130) feat: Decouple creating bucket metrics from instrumenting the bucket
- [#147](https://github.com/thanos-io/objstore/pull/147) gcs: Add config to disable retries.

### Changed
- [#38](https://github.com/thanos-io/objstore/pull/38) *: Upgrade minio-go version to `v7.0.45`.
Expand Down
8 changes: 8 additions & 0 deletions providers/gcs/gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ type Config struct {
// Used as storage.Writer.ChunkSize of https://pkg.go.dev/google.golang.org/cloud/storage#Writer
ChunkSizeBytes int `yaml:"chunk_size_bytes"`
noAuth bool `yaml:"no_auth"`

// gcs client retries idempotent operations by default, this option disables retries.
DisableRetries bool `yaml:"disable_retries"`
}

// Bucket implements the store.Bucket and shipper.Bucket interfaces against GCS.
Expand Down Expand Up @@ -172,6 +175,11 @@ func newBucket(ctx context.Context, logger log.Logger, gc Config, opts []option.
name: gc.Bucket,
chunkSize: gc.ChunkSizeBytes,
}

if gc.DisableRetries {
bkt.bkt = bkt.bkt.Retryer(storage.WithPolicy(storage.RetryNever))
}

return bkt, nil
}

Expand Down
Loading