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,18 +2,14 @@ package test
import (
"context"
"os"
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/infra/db"
"github.com/grafana/grafana/pkg/infra/tracing"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/storage/unified/resource"
"github.com/grafana/grafana/pkg/storage/unified/search"
"github.com/grafana/grafana/pkg/storage/unified/sql"
"github.com/grafana/grafana/pkg/storage/unified/sql/db/dbimpl"
test "github.com/grafana/grafana/pkg/storage/unified/testing"
@@ -46,48 +42,3 @@ func TestIntegrationBenchmarkSQLStorageBackend(t *testing.T) {
}
test.BenchmarkStorageBackend(t, newTestBackend(t), opts)
}
func TestIntegrationBenchmarkResourceServer(t *testing.T) {
t.Skip("skipping slow test, causing CI to fail due to timeout")
testutil.SkipIntegrationTestInShortMode(t)
ctx := context.Background()
opts := &test.BenchmarkOptions{
NumResources: 1000,
Concurrency: 10,
NumNamespaces: 1,
NumGroups: 1,
NumResourceTypes: 1,
}
tempDir := t.TempDir()
t.Cleanup(func() {
_ = os.RemoveAll(tempDir)
})
// Create a new bleve backend
search, err := search.NewBleveBackend(search.BleveOptions{
Root: tempDir,
}, tracing.NewNoopTracerService(), featuremgmt.WithFeatures(), nil)
require.NoError(t, err)
require.NotNil(t, search)
t.Cleanup(search.CloseAllIndexes)
// Create a new resource backend
dbstore := db.InitTestDB(t)
eDB, err := dbimpl.ProvideResourceDB(dbstore, setting.NewCfg(), nil)
require.NoError(t, err)
require.NotNil(t, eDB)
storage, err := sql.NewBackend(sql.BackendOptions{
DBProvider: eDB,
IsHA: false,
})
require.NoError(t, err)
require.NotNil(t, storage)
err = storage.Init(ctx)
require.NoError(t, err)
test.BenchmarkIndexServer(t, ctx, storage, search, opts)
}