Skip to content

Add dry-run mode for XDC system workflows#9391

Open
laniehei wants to merge 1 commit intomainfrom
lanie/skip-xdc-workflows
Open

Add dry-run mode for XDC system workflows#9391
laniehei wants to merge 1 commit intomainfrom
lanie/skip-xdc-workflows

Conversation

@laniehei
Copy link
Member

Summary

  • Adds a worker.dryRunMode dynamic config flag that, when enabled on a cell, causes XDC system workflows (force-replication, namespace-handover) to complete immediately without doing real work
  • This enables testing control plane globalization/failover/deglobalization code paths end-to-end without the time complexity of actually running force replication (which can take hours)

Motivation

The control plane CICD MultiRegionSuite tests invoke real temporal server system workflows (force-replication, handover) on test cells. Force replication lists, replicates, and verifies all workflows between cells, taking hours.

The tradeoff with alternative approaches (e.g., mocking the data-plane client interface in the control plane) is that mock interfaces don't stay up to date as the server evolves. With this approach, all control plane code paths execute against a real temporal server with real gRPC serialization — the server just returns immediately from XDC workflows when dry-run mode is enabled.

Changes

  • common/dynamicconfig/constants.go: New WorkerDryRunMode global bool setting (default false)
  • service/worker/migration/activities.go: dryRunMode field on activities struct + IsDryRunMode local activity
  • service/worker/migration/fx.go: Wire WorkerDryRunMode into activities
  • service/worker/migration/force_replication_workflow.go: isDryRunMode helper + skip checks in V1 and V2 (after query handler setup)
  • service/worker/migration/handover_workflow.go: Skip check after param validation (V2 delegates to V1, so covered)

Enabling on a cell

# Via dynamic config
{"worker.dryRunMode": [{"value": true}]}

Test plan

  • go test -tags test_dep ./service/worker/migration/... passes
  • go build ./... compiles

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@laniehei laniehei requested review from a team as code owners February 24, 2026 18:19
Comment on lines +3097 to +3098
WorkerDryRunMode = NewGlobalBoolSetting(
"worker.dryRunMode",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make the name more accurate? there's other stuff going on in the worker besides xdc

Suggested change
WorkerDryRunMode = NewGlobalBoolSetting(
"worker.dryRunMode",
WorkerXDCDryRunMode = NewGlobalBoolSetting(
"worker.xdcDryRunMode",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants