From 5f4b8fc9e44ac386ef5bfc64dd5f8f47b72f8ef9 Mon Sep 17 00:00:00 2001 From: Christian Haudum Date: Tue, 9 Jul 2024 13:13:06 +0200 Subject: [PATCH] fix: Fix panic in BloomStore initialisation (#13457) 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 --- pkg/loki/loki.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/loki/loki.go b/pkg/loki/loki.go index 91dde1b8ef14..32555391dd3c 100644 --- a/pkg/loki/loki.go +++ b/pkg/loki/loki.go @@ -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) @@ -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},