Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove DefaultVisibilityIndexName from history config #4189

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions service/history/configs/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ import (

// Config represents configuration for history service
type Config struct {
NumberOfShards int32
DefaultVisibilityIndexName string
NumberOfShards int32

EnableReplicationStream dynamicconfig.BoolPropertyFn

Expand Down Expand Up @@ -306,10 +305,9 @@ const (
)

// NewConfig returns new service config with default values
func NewConfig(dc *dynamicconfig.Collection, numberOfShards int32, isAdvancedVisibilityConfigExist bool, defaultVisibilityIndex string) *Config {
func NewConfig(dc *dynamicconfig.Collection, numberOfShards int32, isAdvancedVisibilityConfigExist bool) *Config {
cfg := &Config{
NumberOfShards: numberOfShards,
DefaultVisibilityIndexName: defaultVisibilityIndex,
NumberOfShards: numberOfShards,

EnableReplicationStream: dc.GetBoolProperty(dynamicconfig.EnableReplicationStream, false),

Expand Down
16 changes: 0 additions & 16 deletions service/history/fx.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ import (
"go.temporal.io/server/common/metrics"
"go.temporal.io/server/common/namespace"
persistenceClient "go.temporal.io/server/common/persistence/client"
"go.temporal.io/server/common/persistence/sql/sqlplugin/mysql"
"go.temporal.io/server/common/persistence/sql/sqlplugin/postgresql"
"go.temporal.io/server/common/persistence/sql/sqlplugin/sqlite"
"go.temporal.io/server/common/persistence/visibility"
"go.temporal.io/server/common/persistence/visibility/manager"
"go.temporal.io/server/common/persistence/visibility/store/elasticsearch"
Expand Down Expand Up @@ -167,22 +164,9 @@ func ConfigProvider(
persistenceConfig config.Persistence,
esConfig *esclient.Config,
) *configs.Config {
indexName := ""
if persistenceConfig.StandardVisibilityConfigExist() {
storeConfig := persistenceConfig.DataStores[persistenceConfig.VisibilityStore]
if storeConfig.SQL != nil {
switch storeConfig.SQL.PluginName {
case mysql.PluginNameV8, postgresql.PluginNameV12, sqlite.PluginName:
indexName = storeConfig.SQL.DatabaseName
}
}
} else if persistenceConfig.AdvancedVisibilityConfigExist() {
indexName = esConfig.GetVisibilityIndex()
}
return configs.NewConfig(dc,
persistenceConfig.NumHistoryShards,
persistenceConfig.AdvancedVisibilityConfigExist(),
indexName,
)
}

Expand Down
2 changes: 1 addition & 1 deletion service/history/historyEngine.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func NewEngineWithShardContext(
config.SearchAttributesNumberOfKeysLimit,
config.SearchAttributesSizeOfValueLimit,
config.SearchAttributesTotalSizeLimit,
config.DefaultVisibilityIndexName,
persistenceVisibilityMgr.GetIndexName(),
visibility.AllowListForValidation(persistenceVisibilityMgr.GetStoreNames()),
)

Expand Down
2 changes: 1 addition & 1 deletion service/history/historyEngine2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func (s *engine2Suite) SetupTest() {
s.config.SearchAttributesNumberOfKeysLimit,
s.config.SearchAttributesSizeOfValueLimit,
s.config.SearchAttributesTotalSizeLimit,
s.config.DefaultVisibilityIndexName,
"",
false,
),
workflowConsistencyChecker: api.NewWorkflowConsistencyChecker(mockShard, s.workflowCache),
Expand Down
1 change: 0 additions & 1 deletion service/history/queue_factory_base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ func getModuleDependencies(controller *gomock.Controller, c *moduleTestCase) fx.
dynamicconfig.NewNoopCollection(),
1,
false,
"",
)
archivalMetadata := getArchivalMetadata(controller, c)
clusterMetadata := cluster.NewMockMetadata(controller)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ func (s *streamReceiverMonitorSuite) SetupTest() {
dynamicconfig.NewNoopCollection(),
1,
false,
"",
),
ClientBean: s.clientBean,
MetricsHandler: metrics.NoopMetricsHandler,
Expand Down
2 changes: 1 addition & 1 deletion service/history/tests/vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ var (

func NewDynamicConfig() *configs.Config {
dc := dynamicconfig.NewNoopCollection()
config := configs.NewConfig(dc, 1, false, "")
config := configs.NewConfig(dc, 1, false)
// reduce the duration of long poll to increase test speed
config.LongPollExpirationInterval = dc.GetDurationPropertyFilteredByNamespace(dynamicconfig.HistoryLongPollExpirationInterval, 10*time.Second)
config.EnableActivityEagerExecution = dynamicconfig.GetBoolPropertyFnFilteredByNamespace(true)
Expand Down
2 changes: 1 addition & 1 deletion service/history/workflowTaskHandlerCallbacks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (s *WorkflowTaskHandlerCallbackSuite) SetupTest() {
config.SearchAttributesNumberOfKeysLimit,
config.SearchAttributesSizeOfValueLimit,
config.SearchAttributesTotalSizeLimit,
config.DefaultVisibilityIndexName,
"",
false,
),
workflowConsistencyChecker: api.NewWorkflowConsistencyChecker(mockShard, workflowCache),
Expand Down