Skip to content

Commit

Permalink
Revert "Revert "fix: Skip reloading certain search indices (#1270)" (#…
Browse files Browse the repository at this point in the history
…1272)" (#1273)

This reverts commit 2a4f408.
  • Loading branch information
himank committed Jun 12, 2023
1 parent 2a4f408 commit cf71306
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/config/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,8 @@ type SearchConfig struct {
AuthKey string `json:"auth_key" mapstructure:"auth_key" yaml:"auth_key"`
ReadEnabled bool `json:"read_enabled" mapstructure:"read_enabled" yaml:"read_enabled"`
WriteEnabled bool `json:"write_enabled" mapstructure:"write_enabled" yaml:"write_enabled"`
// SkipPrefixedIndices is a temporary solution that skips reloading certain search indices
SkipPrefixedIndices string `json:"skip_prefixed_indices" mapstructure:"skip_prefixed_indices" yaml:"skip_prefixed_indices"`
// StorageEnabled only applies to standalone search indexes. This is to enable persisting search indexes to storage.
StorageEnabled bool `json:"storage_enabled" mapstructure:"storage_enabled" yaml:"storage_enabled"`
// Chunking allows us to persist bigger search indexes payload in storage.
Expand Down
5 changes: 5 additions & 0 deletions server/metadata/tenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"context"
"fmt"
"reflect"
"strings"
"sync"
"testing"
"time"
Expand Down Expand Up @@ -814,6 +815,10 @@ func (tenant *Tenant) reloadSearch(ctx context.Context, tx transaction.Tx, proje
searchObj := NewSearch()

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

0 comments on commit cf71306

Please sign in to comment.