Skip to content

Commit 3f91a4f

Browse files
committed
Reduce backoff time + update doc
Signed-off-by: Justin Jung <[email protected]>
1 parent 883d8bc commit 3f91a4f

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

docs/blocks-storage/querier.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ querier:
238238
[store_gateway_consistency_check_max_attempts: <int> | default = 3]
239239

240240
# The maximum number of times we attempt fetching data from ingesters for
241-
# retryable errors.
241+
# retryable errors (ex. partial data returned).
242242
# CLI flag: -querier.ingester-query-max-attempts
243243
[ingester_query_max_attempts: <int> | default = 1]
244244

docs/configuration/config-file-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4166,7 +4166,7 @@ store_gateway_client:
41664166
[store_gateway_consistency_check_max_attempts: <int> | default = 3]
41674167

41684168
# The maximum number of times we attempt fetching data from ingesters for
4169-
# retryable errors.
4169+
# retryable errors (ex. partial data returned).
41704170
# CLI flag: -querier.ingester-query-max-attempts
41714171
[ingester_query_max_attempts: <int> | default = 1]
41724172

pkg/querier/distributor_queryable.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ import (
2525
"github.com/cortexproject/cortex/pkg/util/spanlogger"
2626
)
2727

28-
const retryMinBackoff = time.Second
29-
const retryMaxBackoff = 5 * time.Second
28+
const retryMinBackoff = time.Millisecond
29+
const retryMaxBackoff = 5 * time.Millisecond
3030

3131
// Distributor is the read interface to the distributor, made an interface here
3232
// to reduce package coupling.
@@ -203,7 +203,7 @@ 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 {
206+
if q.ingesterQueryMaxAttempts <= 1 {
207207
return queryFunc()
208208
}
209209

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", 1, "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 (ex. partial data returned).")
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)