Improve search index eviction (#111542)

* Modify index eviction mechanism such that unowned indexes are also evicted.

* Propagate OwnsIndex function to bleve backend

Fix tests.

Stop eviction goroutine when stopping backend.

Make linter happy.

Make sure we stop backend created by tests.

Review suggestion.

Removed newline.
This commit is contained in:
Peter Štibraný authored and GitHub committed 2025-09-24 16:54:35 +02:00
1 parent a4dabc31ed
commit 357aa7d314
13 files changed
+266 -146

No files matched your search

@@ -2,7 +2,6 @@ package test
import (
"context"
"os"
"sync"
"testing"
"time"
@@ -98,17 +97,14 @@ func TestIntegrationSearchAndStorage(t *testing.T) {
ctx := context.Background()
tempDir := t.TempDir()
t.Cleanup(func() {
_ = os.RemoveAll(tempDir)
})
// Create a new bleve backend
search, err := search.NewBleveBackend(search.BleveOptions{
FileThreshold: 0,
Root: tempDir,
Root: t.TempDir(),
}, tracing.NewNoopTracerService(), nil)
require.NoError(t, err)
require.NotNil(t, search)
t.Cleanup(search.Stop)
// Create a new resource backend
storage := newTestBackend(t, false, 0)