Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
zigeH committed Nov 6, 2024
1 parent df12b9a commit da4a538
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions common/dynamicconfig/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ import (
)

var (
// TEST ONLY DO NOT LAND
HistoryShouldFailReplicationTask = "history.shouldFailReplicationTask"

// keys for dynamic config itself
DynamicConfigSubscriptionCallback = NewGlobalTypedSetting(
"dynamicconfig.subscriptionCallback",
Expand Down
2 changes: 2 additions & 0 deletions service/history/configs/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,8 @@ type Config struct {
BreakdownMetricsByTaskQueue dynamicconfig.BoolPropertyFnWithTaskQueueFilter

LogAllReqErrors dynamicconfig.BoolPropertyFnWithNamespaceFilter

ShouldFailReplicationTask dynamicconfig.BoolPropertyFn
}

// NewConfig returns new service config with default values
Expand Down
4 changes: 4 additions & 0 deletions service/history/replication/executable_history_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit da4a538

Please sign in to comment.