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

Test Only:create dlq task between test cells #6765

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
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
7 changes: 7 additions & 0 deletions config/dynamicconfig/development-cass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,10 @@ history.enableWorkflowExecutionTimeoutTimer:
- value: true
history.hostLevelCacheMaxSize:
- value: 8192

history.shouldFailReplicationTask: # The test switch to make all replication tasks go to the DLQ
- value: true
history.enableReplicationStream: # We use streaming for replication in production
- value: true
history.enableHistoryReplicationDLQV2: # This turns on the replication DLQ V2 in production
- value: true
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
Loading