Skip to content

Commit 883d8bc

Browse files
committed
Change default retry from 3 to 1
Signed-off-by: Justin Jung <[email protected]>
1 parent 761741f commit 883d8bc

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

docs/blocks-storage/querier.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ querier:
240240
# The maximum number of times we attempt fetching data from ingesters for
241241
# retryable errors.
242242
# CLI flag: -querier.ingester-query-max-attempts
243-
[ingester_query_max_attempts: <int> | default = 3]
243+
[ingester_query_max_attempts: <int> | default = 1]
244244

245245
# When distributor's sharding strategy is shuffle-sharding and this setting is
246246
# > 0, queriers fetch in-memory series from the minimum set of required

docs/configuration/config-file-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4168,7 +4168,7 @@ store_gateway_client:
41684168
# The maximum number of times we attempt fetching data from ingesters for
41694169
# retryable errors.
41704170
# CLI flag: -querier.ingester-query-max-attempts
4171-
[ingester_query_max_attempts: <int> | default = 3]
4171+
[ingester_query_max_attempts: <int> | default = 1]
41724172

41734173
# When distributor's sharding strategy is shuffle-sharding and this setting is >
41744174
# 0, queriers fetch in-memory series from the minimum set of required ingesters,

pkg/querier/distributor_queryable.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,10 @@ func (q *distributorQuerier) streamingSelect(ctx context.Context, sortSeries, pa
203203
}
204204

205205
func (q *distributorQuerier) queryWithRetry(ctx context.Context, queryFunc func() (*client.QueryStreamResponse, error)) (*client.QueryStreamResponse, error) {
206+
if q.ingesterQueryMaxAttempts == 1 {
207+
return queryFunc()
208+
}
209+
206210
var result *client.QueryStreamResponse
207211
var err error
208212

@@ -285,6 +289,10 @@ func (q *distributorQuerier) LabelNames(ctx context.Context, hints *storage.Labe
285289
}
286290

287291
func (q *distributorQuerier) labelsWithRetry(ctx context.Context, labelsFunc func() ([]string, error)) ([]string, error) {
292+
if q.ingesterQueryMaxAttempts == 1 {
293+
return labelsFunc()
294+
}
295+
288296
var result []string
289297
var err error
290298

pkg/querier/querier.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func (cfg *Config) RegisterFlags(f *flag.FlagSet) {
128128
f.StringVar(&cfg.StoreGatewayAddresses, "querier.store-gateway-addresses", "", "Comma separated list of store-gateway addresses in DNS Service Discovery format. This option should be set when using the blocks storage and the store-gateway sharding is disabled (when enabled, the store-gateway instances form a ring and addresses are picked from the ring).")
129129
f.BoolVar(&cfg.StoreGatewayQueryStatsEnabled, "querier.store-gateway-query-stats-enabled", true, "If enabled, store gateway query stats will be logged using `info` log level.")
130130
f.IntVar(&cfg.StoreGatewayConsistencyCheckMaxAttempts, "querier.store-gateway-consistency-check-max-attempts", maxFetchSeriesAttempts, "The maximum number of times we attempt fetching missing blocks from different store-gateways. If no more store-gateways are left (ie. due to lower replication factor) than we'll end the retries earlier")
131-
f.IntVar(&cfg.IngesterQueryMaxAttempts, "querier.ingester-query-max-attempts", 3, "The maximum number of times we attempt fetching data from ingesters for retryable errors.")
131+
f.IntVar(&cfg.IngesterQueryMaxAttempts, "querier.ingester-query-max-attempts", 1, "The maximum number of times we attempt fetching data from ingesters for retryable errors.")
132132
f.DurationVar(&cfg.LookbackDelta, "querier.lookback-delta", 5*time.Minute, "Time since the last sample after which a time series is considered stale and ignored by expression evaluations.")
133133
f.DurationVar(&cfg.ShuffleShardingIngestersLookbackPeriod, "querier.shuffle-sharding-ingesters-lookback-period", 0, "When distributor's sharding strategy is shuffle-sharding and this setting is > 0, queriers fetch in-memory series from the minimum set of required ingesters, selecting only ingesters which may have received series since 'now - lookback period'. The lookback period should be greater or equal than the configured 'query store after' and 'query ingesters within'. If this setting is 0, queriers always query all ingesters (ingesters shuffle sharding on read path is disabled).")
134134
f.BoolVar(&cfg.ThanosEngine, "querier.thanos-engine", false, "Experimental. Use Thanos promql engine https://github.com/thanos-io/promql-engine rather than the Prometheus promql engine.")

0 commit comments

Comments
 (0)