Skip to content

Commit

Permalink
Code review feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Pillitteri <[email protected]>
  • Loading branch information
56quarters committed Jan 10, 2025
1 parent 655630e commit e42e7c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions pkg/querier/blocks_store_queryable.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,16 +244,14 @@ func NewBlocksStoreQueryableFromConfig(querierCfg Config, gatewayCfg storegatewa
return nil, errors.Wrap(err, "failed to create store-gateway ring client")
}

var expandedReplication storegateway.ExpandedReplication
var expandedReplication storegateway.ExpandedReplication = storegateway.NewNopExpandedReplication()
if gatewayCfg.ExpandedReplication.Enabled {
expandedReplication = storegateway.NewMaxTimeExpandedReplication(
gatewayCfg.ExpandedReplication.MaxTimeThreshold,
// Exclude blocks which have recently become eligible for expanded replication, in order to give
// enough time to store-gateways to discover and load them (3 times the sync interval)
mimir_tsdb.NewBlockDiscoveryDelayMultiplier*storageCfg.BucketStore.SyncInterval,
)
} else {
expandedReplication = storegateway.NewNopExpandedReplication()
}

stores, err = newBlocksStoreReplicationSet(storesRing, randomLoadBalancing, expandedReplication, limits, querierCfg.StoreGatewayClient, logger, reg)
Expand Down
4 changes: 1 addition & 3 deletions pkg/storegateway/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,9 @@ func newStoreGateway(gatewayCfg Config, storageCfg mimir_tsdb.BlocksStorageConfi
return nil, errors.Wrap(err, "create ring client")
}

var expandedReplication ExpandedReplication
var expandedReplication ExpandedReplication = NewNopExpandedReplication()
if gatewayCfg.ExpandedReplication.Enabled {
expandedReplication = NewMaxTimeExpandedReplication(gatewayCfg.ExpandedReplication.MaxTimeThreshold, 0)
} else {
expandedReplication = NewNopExpandedReplication()
}

shardingStrategy = NewShuffleShardingStrategy(g.ring, lifecyclerCfg.ID, lifecyclerCfg.Addr, expandedReplication, limits, logger)
Expand Down

0 comments on commit e42e7c9

Please sign in to comment.