From cff9f43dd6fb5e90c875c14c138ea39b58202dff Mon Sep 17 00:00:00 2001 From: Ashwanth Date: Thu, 24 Oct 2024 12:02:13 +0530 Subject: [PATCH] fix(s3): disable client retries when congestion control is enabled (#14588) --- docs/sources/shared/configuration.md | 7 ------- pkg/storage/factory.go | 6 +++++- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/docs/sources/shared/configuration.md b/docs/sources/shared/configuration.md index 728e61e5096e..29d61b46b94d 100644 --- a/docs/sources/shared/configuration.md +++ b/docs/sources/shared/configuration.md @@ -5650,13 +5650,6 @@ congestion_control: # CLI flag: -store.max-parallel-get-chunk [max_parallel_get_chunk: | default = 150] -# Enables the use of thanos-io/objstore clients for connecting to object -# storage. When set to true, the configuration inside -# `storage_config.object_store` or `common.storage.object_store` block takes -# effect. -# CLI flag: -use-thanos-objstore -[use_thanos_objstore: | default = false] - # The maximum number of chunks to fetch per batch. # CLI flag: -store.max-chunk-batch-size [max_chunk_batch_size: | default = 50] diff --git a/pkg/storage/factory.go b/pkg/storage/factory.go index e0cc1ff0e738..69a7693fbe83 100644 --- a/pkg/storage/factory.go +++ b/pkg/storage/factory.go @@ -295,7 +295,7 @@ type Config struct { DisableBroadIndexQueries bool `yaml:"disable_broad_index_queries"` MaxParallelGetChunk int `yaml:"max_parallel_get_chunk"` - UseThanosObjstore bool `yaml:"use_thanos_objstore" doc:"hidden` + UseThanosObjstore bool `yaml:"use_thanos_objstore" doc:"hidden"` ObjectStore bucket.Config `yaml:"object_store" doc:"hidden"` MaxChunkBatchSize int `yaml:"max_chunk_batch_size"` @@ -650,6 +650,10 @@ func internalNewObjectClient(storeName, component string, cfg Config, clientMetr } s3Cfg = awsCfg.S3Config } + + if cfg.CongestionControl.Enabled { + s3Cfg.BackoffConfig.MaxRetries = 1 + } return aws.NewS3ObjectClient(s3Cfg, cfg.Hedging) case types.StorageTypeAlibabaCloud: