Cleanup of old search functionality (#110861)

* Remove support for initMinSize.
Remove support for searchAfterWrite option, now it defaults to true.

* Remove reference to deprecated feature toggle.

* Remove feature toggle completely.

* Remove code related to indexing on watch events.

* Fix compilation error.

* Remove unused field.
This commit is contained in:
Peter Štibraný
2025-09-11 08:23:03 +00:00
committed by GitHub
parent ecf08ad7d5
commit 6fa6a5708a
23 changed files with 164 additions and 1054 deletions
+2 -11
View File
@@ -22,6 +22,7 @@ import (
claims "github.com/grafana/authlib/types"
"github.com/grafana/dskit/backoff"
"github.com/grafana/dskit/ring"
"github.com/grafana/grafana/pkg/apimachinery/utils"
secrets "github.com/grafana/grafana/pkg/registry/apis/secret/contracts"
"github.com/grafana/grafana/pkg/storage/unified/resourcepb"
@@ -182,13 +183,6 @@ type SearchOptions struct {
// Skip building index on startup for small indexes
InitMinCount int
// Build empty index on startup for large indexes so that
// we don't re-attempt to build the index later.
InitMaxCount int
// Channel to watch for index events (for testing)
IndexEventsChan chan *IndexEvent
// Interval for periodic index rebuilds (0 disables periodic rebuilds)
RebuildInterval time.Duration
@@ -243,9 +237,6 @@ type ResourceServerOptions struct {
Ring *ring.Ring
RingLifecycler *ring.BasicLifecycler
// Enable strong consistency for searches. When enabled, index is always updated with latest changes before search.
SearchAfterWrite bool
}
func NewResourceServer(opts ResourceServerOptions) (*server, error) {
@@ -343,7 +334,7 @@ func NewResourceServer(opts ResourceServerOptions) (*server, error) {
if opts.Search.Resources != nil {
var err error
s.search, err = newSearchSupport(opts.Search, s.backend, s.access, s.blob, opts.Tracer, opts.IndexMetrics, opts.Ring, opts.RingLifecycler, opts.SearchAfterWrite)
s.search, err = newSearchSupport(opts.Search, s.backend, s.access, s.blob, opts.Tracer, opts.IndexMetrics, opts.Ring, opts.RingLifecycler)
if err != nil {
return nil, err
}