diff --git a/common/dynamicconfig/constants.go b/common/dynamicconfig/constants.go index 3dbfe25accd..52c7bcc1ff8 100644 --- a/common/dynamicconfig/constants.go +++ b/common/dynamicconfig/constants.go @@ -37,6 +37,9 @@ import ( ) var ( + // TEST ONLY DO NOT LAND + HistoryShouldFailReplicationTask = "history.shouldFailReplicationTask" + // keys for dynamic config itself DynamicConfigSubscriptionCallback = NewGlobalTypedSetting( "dynamicconfig.subscriptionCallback", diff --git a/service/history/configs/config.go b/service/history/configs/config.go index d0558876e99..de1e0d15919 100644 --- a/service/history/configs/config.go +++ b/service/history/configs/config.go @@ -376,6 +376,8 @@ type Config struct { BreakdownMetricsByTaskQueue dynamicconfig.BoolPropertyFnWithTaskQueueFilter LogAllReqErrors dynamicconfig.BoolPropertyFnWithNamespaceFilter + + ShouldFailReplicationTask dynamicconfig.BoolPropertyFn } // NewConfig returns new service config with default values diff --git a/service/history/replication/executable_history_task.go b/service/history/replication/executable_history_task.go index b8a2731492c..dd9e0730c24 100644 --- a/service/history/replication/executable_history_task.go +++ b/service/history/replication/executable_history_task.go @@ -119,6 +119,10 @@ func (e *ExecutableHistoryTask) QueueID() interface{} { } func (e *ExecutableHistoryTask) Execute() error { + if e.Config.ShouldFailReplicationTask() { + return serviceerror.NewInvalidArgument("forced replication error") + } + if e.TerminalState() { return nil }