Skip to content

Commit cf71306

Browse files
authored
Revert "Revert "fix: Skip reloading certain search indices (#1270)" (#1272)" (#1273)
This reverts commit 2a4f408.
1 parent 2a4f408 commit cf71306

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

server/config/options.go

+2
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,8 @@ type SearchConfig struct {
619619
AuthKey string `json:"auth_key" mapstructure:"auth_key" yaml:"auth_key"`
620620
ReadEnabled bool `json:"read_enabled" mapstructure:"read_enabled" yaml:"read_enabled"`
621621
WriteEnabled bool `json:"write_enabled" mapstructure:"write_enabled" yaml:"write_enabled"`
622+
// SkipPrefixedIndices is a temporary solution that skips reloading certain search indices
623+
SkipPrefixedIndices string `json:"skip_prefixed_indices" mapstructure:"skip_prefixed_indices" yaml:"skip_prefixed_indices"`
622624
// StorageEnabled only applies to standalone search indexes. This is to enable persisting search indexes to storage.
623625
StorageEnabled bool `json:"storage_enabled" mapstructure:"storage_enabled" yaml:"storage_enabled"`
624626
// Chunking allows us to persist bigger search indexes payload in storage.

server/metadata/tenant.go

+5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"context"
2020
"fmt"
2121
"reflect"
22+
"strings"
2223
"sync"
2324
"testing"
2425
"time"
@@ -814,6 +815,10 @@ func (tenant *Tenant) reloadSearch(ctx context.Context, tx transaction.Tx, proje
814815
searchObj := NewSearch()
815816

816817
for _, searchMD := range projMetadata.SearchMetadata {
818+
if config.DefaultConfig.Search.SkipPrefixedIndices != "" && strings.HasPrefix(searchMD.Name, config.DefaultConfig.Search.SkipPrefixedIndices) {
819+
log.Warn().Str("index", searchMD.Name).Msg("Skipped reloading")
820+
continue
821+
}
817822
schV, err := tenant.searchSchemaStore.GetLatest(ctx, tx, tenant.namespace.Id(), project.id, searchMD.Name)
818823
if err != nil {
819824
return nil, err

0 commit comments

Comments
 (0)