update storage-api to only build index if it owns the namespace (#108418)

* update storage-api to only build index if it owns the namespace

---------

Co-authored-by: Mustafa Sencer Özcan <mustafasencer.ozcan@grafana.com>
This commit is contained in:
Will Assis
2025-07-23 15:59:24 -04:00
committed by GitHub
parent 4df4f9cc07
commit 981fdb29d4
6 changed files with 73 additions and 16 deletions
+5
View File
@@ -9,6 +9,7 @@ import (
"go.opentelemetry.io/otel/trace"
"github.com/grafana/authlib/types"
"github.com/grafana/dskit/ring"
"github.com/grafana/dskit/services"
infraDB "github.com/grafana/grafana/pkg/infra/db"
@@ -37,6 +38,8 @@ type ServerOptions struct {
IndexMetrics *resource.BleveIndexMetrics
Features featuremgmt.FeatureToggles
QOSQueue QOSEnqueueDequeuer
Ring *ring.Ring
RingLifecycler *ring.BasicLifecycler
}
// Creates a new ResourceServer
@@ -96,6 +99,8 @@ func NewResourceServer(
serverOptions.Search = opts.SearchOptions
serverOptions.IndexMetrics = opts.IndexMetrics
serverOptions.QOSQueue = opts.QOSQueue
serverOptions.Ring = opts.Ring
serverOptions.RingLifecycler = opts.RingLifecycler
return resource.NewResourceServer(serverOptions)
}