diff --git a/service/history/configs/config.go b/service/history/configs/config.go index 694d1b5b12a..b320424648b 100644 --- a/service/history/configs/config.go +++ b/service/history/configs/config.go @@ -37,8 +37,7 @@ import ( // Config represents configuration for history service type Config struct { - NumberOfShards int32 - DefaultVisibilityIndexName string + NumberOfShards int32 EnableReplicationStream dynamicconfig.BoolPropertyFn @@ -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), diff --git a/service/history/fx.go b/service/history/fx.go index 763da16b694..430386c22b3 100644 --- a/service/history/fx.go +++ b/service/history/fx.go @@ -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" @@ -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, ) } diff --git a/service/history/historyEngine.go b/service/history/historyEngine.go index 0f9c9c25ca9..e821755c1fa 100644 --- a/service/history/historyEngine.go +++ b/service/history/historyEngine.go @@ -232,7 +232,7 @@ func NewEngineWithShardContext( config.SearchAttributesNumberOfKeysLimit, config.SearchAttributesSizeOfValueLimit, config.SearchAttributesTotalSizeLimit, - config.DefaultVisibilityIndexName, + persistenceVisibilityMgr.GetIndexName(), visibility.AllowListForValidation(persistenceVisibilityMgr.GetStoreNames()), ) diff --git a/service/history/historyEngine2_test.go b/service/history/historyEngine2_test.go index c087c6e5df5..dadf455b33f 100644 --- a/service/history/historyEngine2_test.go +++ b/service/history/historyEngine2_test.go @@ -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), diff --git a/service/history/queue_factory_base_test.go b/service/history/queue_factory_base_test.go index 5e74ca97687..85be79fae83 100644 --- a/service/history/queue_factory_base_test.go +++ b/service/history/queue_factory_base_test.go @@ -150,7 +150,6 @@ func getModuleDependencies(controller *gomock.Controller, c *moduleTestCase) fx. dynamicconfig.NewNoopCollection(), 1, false, - "", ) archivalMetadata := getArchivalMetadata(controller, c) clusterMetadata := cluster.NewMockMetadata(controller) diff --git a/service/history/replication/stream_receiver_monitor_test.go b/service/history/replication/stream_receiver_monitor_test.go index 1fb99f70136..e6a54976d85 100644 --- a/service/history/replication/stream_receiver_monitor_test.go +++ b/service/history/replication/stream_receiver_monitor_test.go @@ -88,7 +88,6 @@ func (s *streamReceiverMonitorSuite) SetupTest() { dynamicconfig.NewNoopCollection(), 1, false, - "", ), ClientBean: s.clientBean, MetricsHandler: metrics.NoopMetricsHandler, diff --git a/service/history/tests/vars.go b/service/history/tests/vars.go index 2ba316227d3..528131e9da2 100644 --- a/service/history/tests/vars.go +++ b/service/history/tests/vars.go @@ -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) diff --git a/service/history/workflowTaskHandlerCallbacks_test.go b/service/history/workflowTaskHandlerCallbacks_test.go index 0093c406897..3f8e24ff84c 100644 --- a/service/history/workflowTaskHandlerCallbacks_test.go +++ b/service/history/workflowTaskHandlerCallbacks_test.go @@ -124,7 +124,7 @@ func (s *WorkflowTaskHandlerCallbackSuite) SetupTest() { config.SearchAttributesNumberOfKeysLimit, config.SearchAttributesSizeOfValueLimit, config.SearchAttributesTotalSizeLimit, - config.DefaultVisibilityIndexName, + "", false, ), workflowConsistencyChecker: api.NewWorkflowConsistencyChecker(mockShard, workflowCache),