Skip to content

Document self-hosted Namespace failover behavior - #5286

Merged
Duncanma merged 4 commits into
mainfrom
docs/self-hosted-failover-guidance
Sep 10, 2026
Merged

Document self-hosted Namespace failover behavior#5286
Duncanma merged 4 commits into
mainfrom
docs/self-hosted-failover-guidance

Conversation

@lukeknep

@lukeknep lukeknep commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a planned failover procedure using the built-in namespace-handover Workflow.
  • Explain how direct failover behavior differs when the source or destination Temporal Service receives the update.
  • Clarify why Namespace cache refresh does not extend the stale-task correctness window.
  • Document why Activities must remain idempotent and why stopping Workers or limiting retries does not guarantee exactly-once effects.

Why

Resolve the recurring self-hosted Multi-Cluster Replication questions captured in this internal Slack thread.

Validation

  • vale --config .vale-ci.ini docs/production-deployment/self-hosted-guide/multi-cluster-replication.mdx docs/encyclopedia/temporal-service/multi-cluster-replication.mdx
  • yarn build
  • Rendered-page link and anchor checks for both changed pages

@lukeknep
lukeknep requested a review from a team as a code owner September 9, 2026 18:09
@vercel

vercel Bot commented Sep 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
temporal-documentation Ready Ready Preview Sep 10, 2026 7:46pm UTC

Request Review

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

📖 Docs PR preview links

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4469dbf2de

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +75 to +76
- If the destination Temporal Service receives the update, both Temporal Services can temporarily consider the
Namespace active.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Update the Global Namespace failover guidance

When readers start from docs/encyclopedia/namespaces/global-namespaces.mdx, lines 18–23 still send them directly to operator namespace update and state that only one Cluster is active at any time. That conflicts with this new guidance: a direct update is now described as forced-only and can temporarily make both Services active. Update that page to point planned failovers to this handover procedure and qualify the single-active statement; otherwise operators can follow the old link and enter the rollback and duplicate-effect window this section is intended to avoid.

AGENTS.md reference: AGENTS.md:L236-L242

Useful? React with 👍 / 👎.

@lukeknep
lukeknep requested review from temporal-nick and a balanced review from Copilot September 9, 2026 20:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new encyclopedia text introduces “direct failover update” without defining the triggering action, and the self-hosted page’s heading hierarchy/collateral linking needs follow-up for clarity and accessibility.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR expands the self-hosted Multi-Cluster Replication documentation to describe planned vs forced Namespace failover behavior, including how replication/cache behavior affects correctness and why Activities must remain idempotent.

Changes:

  • Adds a planned failover procedure using the namespace-handover Workflow and contrasts it with forced failover via temporal operator namespace update.
  • Documents how the receiving Temporal Service applies failover updates first and why Namespace cache refresh does not extend the stale-task correctness window.
  • Adds guidance on preventing duplicate external side effects after failover (idempotent Activities).
File summaries
File Description
docs/production-deployment/self-hosted-guide/multi-cluster-replication.mdx Adds the self-hosted operational failover procedure, forced failover behavior explanation, and idempotency guidance.
docs/encyclopedia/temporal-service/multi-cluster-replication.mdx Clarifies metadata replication vs cache refresh semantics and links to the self-hosted operational guidance.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/encyclopedia/temporal-service/multi-cluster-replication.mdx Outdated
Comment on lines +29 to +45
## How to fail over a Global Namespace

For a planned failover, run the built-in `namespace-handover` Workflow against the currently active Temporal Service.
The handover Workflow:

1. Waits for the destination Temporal Service to approach the configured replication-lag thresholds.
2. Puts the Namespace into the `handover` replication state, which pauses Workflow mutations and task processing.
3. Waits for the destination Temporal Service to acknowledge every replication task created before the pause.
4. Makes the destination Temporal Service active and restores the Namespace to the `normal` replication state.

This process creates a brief availability gap while traffic is paused, but it prevents Workflow progress from rolling
back at the cutover. If the destination cannot catch up during the handover timeout, the Workflow restores the `normal`
replication state without changing the active Temporal Service.

Connect Temporal CLI to the currently active Temporal Service, then run the handover Workflow in the `temporal-system`
Namespace. Use a unique Workflow Id for each handover:

Comment on lines +110 to 112
#### Namespace versions

A _version_ is a concept in Multi-Cluster Replication that describes the chronological order of events per Namespace.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment on lines +80 to +81
For this reason, send an emergency failover to the destination when the source is unavailable. When both Temporal
Services are available, use the handover Workflow instead of choosing either side for a forced failover.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is redundant

Point Global Namespace failover guidance at the new handover/forced
failover procedure instead of the forced-only CLI update, and qualify
the single-active-Cluster claim to match. Also drop a sentence in the
self-hosted guide that repeated guidance already stated above it.
@Duncanma
Duncanma enabled auto-merge (squash) September 10, 2026 19:44
@Duncanma
Duncanma merged commit 22228bd into main Sep 10, 2026
15 checks passed
@Duncanma
Duncanma deleted the docs/self-hosted-failover-guidance branch September 10, 2026 19:46
prasek pushed a commit that referenced this pull request Sep 11, 2026
* Document self-hosted Namespace failover behavior

* Update multi-cluster replication documentation

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Fix global-namespaces contradiction and trim redundant sentence

Point Global Namespace failover guidance at the new handover/forced
failover procedure instead of the forced-only CLI update, and qualify
the single-active-Cluster claim to match. Also drop a sentence in the
self-hosted guide that repeated guidance already stated above it.

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Duncan Mackenzie <duncan.mackenzie@temporal.io>
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.

4 participants