Skip to content

Commit

Permalink
fix: Fix panic in BloomStore initialisation (#13457)
Browse files Browse the repository at this point in the history
The initialisation of the `BloomStore` service failed with a panic if the index gateways were configured to use `ring` mode.

This happened, because the bloom store requires to wire up the configuration for the shipper store, see
https://github.com/grafana/loki/blob/1a508b0aa/pkg/loki/modules.go#L864-L867

At this time, the index gateway ring manager wasn't initialized yet, leading to a `nil` pointer dereference.

This PR fixes the issue by adding the index gateway ring as dependency of the bloom store so it gets initialised first.

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
  • Loading branch information
chaudum authored Jul 9, 2024
1 parent 1a508b0 commit 5f4b8fc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/loki/loki.go
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ func (t *Loki) setupModuleManager() error {
mm.RegisterModule(RuleEvaluator, t.initRuleEvaluator, modules.UserInvisibleModule)
mm.RegisterModule(TableManager, t.initTableManager)
mm.RegisterModule(Compactor, t.initCompactor)
mm.RegisterModule(BloomStore, t.initBloomStore)
mm.RegisterModule(BloomStore, t.initBloomStore, modules.UserInvisibleModule)
mm.RegisterModule(BloomCompactor, t.initBloomCompactor)
mm.RegisterModule(BloomCompactorRing, t.initBloomCompactorRing, modules.UserInvisibleModule)
mm.RegisterModule(BloomPlanner, t.initBloomPlanner)
Expand Down Expand Up @@ -718,6 +718,7 @@ func (t *Loki) setupModuleManager() error {
BloomCompactor: {Server, BloomStore, BloomCompactorRing, Analytics, Store},
BloomPlanner: {Server, BloomStore, Analytics, Store},
BloomBuilder: {Server, BloomStore, Analytics, Store},
BloomStore: {IndexGatewayRing},
PatternIngester: {Server, MemberlistKV, Analytics},
PatternRingClient: {Server, MemberlistKV, Analytics},
IngesterRF1RingClient: {Server, MemberlistKV, Analytics},
Expand Down

0 comments on commit 5f4b8fc

Please sign in to comment.