Repository navigation
Add the multi-region compute model - #3993
Draft
rossnelson wants to merge 1 commit into
Draft
rossnelson wants to merge 1 commit into
rossnelson wants to merge 1 commit into
Conversation
Groundwork for Serverless Workers on highly available Namespaces, taken from the design prototype in #3951 and rebuilt on main. Answers one question: given a compute config and a Namespace's regions, which scaling groups serve which region. Renders nothing yet. Gating is a single switch, the Namespace's regions. This repo does not decide whether an install has highly available Namespaces — a consumer passes the regions when its own entitlement says so, the same way it already passes the compute providers a Namespace may use. Fewer than two regions means single region, which is every self-hosted install and every Namespace without HA, so the feature stays dark until a consumer opts in and can be released before the API that feeds it. The prototype gated on two things at once: the regions prop and the presence of a regionId on a scaling group. Two conditions that can disagree is how a half-gated feature reaches someone who should not see it, so the compute config gets no vote here. Each region says whether it is the active one rather than the caller sorting the active region first. Temporal Cloud reads that from the replica's mode, so it is known rather than conventional, and an ordering rule is one a caller can break without anything noticing. Region ids are a provider and a region name joined by a hyphen, as in aws-us-west-2. That is already how Cloud spells a Namespace's replica regions, so the two sides join directly. The provider labels read from COMPUTE_PROVIDERS rather than restating it. The prototype added two more switch statements over provider types, which is what #3946 had just finished removing.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Oct 7, 2026
rossnelson
marked this pull request as draft
October 8, 2026 16:19
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Groundwork for Serverless Workers on highly available Namespaces. Renders nothing — this is the model and the gate, so the UI can land in slices.
Taken from the design prototype in #3951 and rebuilt on
main. That PR stays open as the design reference.Description & motivation 💭
Answers one question: given a compute config and a Namespace's regions, which scaling groups serve which region, in the PRD's matching order — an exact
regionIdfirst, then any catch-all.The gate is one switch
The Namespace's regions, and nothing else.
This repo does not decide whether an install has highly available Namespaces. A consumer passes the regions when its own entitlement says so, exactly as it already passes the compute providers a Namespace may use. Fewer than two regions means single region — every self-hosted install, and every Namespace without HA.
So this can ship before the API that feeds it. The feature stays dark until a consumer opts in.
Why the compute config gets no vote
The prototype gated on two things at once: the regions prop and the presence of a
regionIdon a scaling group. Two conditions that can disagree is how a half-gated feature reaches someone who should not see it — and neither was written down as the gate, so a reviewer could not tell what was live.Here a single-region Namespace with a stray
regionIdis still single region. One question, one answer, stated at the top of the module.Each region says whether it is active
Rather than the caller sorting the active region first. Temporal Cloud reads that from the replica's mode, so it is known rather than conventional — and an ordering rule is one a caller can break with nothing noticing.
Design Considerations 🎨
provider-name, as inaws-us-west-2. That is already how Cloud spells a Namespace's replica regions, so the two sides join directly. A plain string rather than a structured value, becauseComputeConfigScalingGroup.region_idis one and a Namespace is in a single cloud today, so the provider is never ambiguous within one Namespace.COMPUTE_PROVIDERS. The prototype added two moreswitchstatements over provider types, which is what Describe a compute provider in one place #3946 had just finished removing.regionIdis optional and read defensively. An empty string reads as unset rather than as a region no Namespace has. The upstream field is Add region_id to ComputeConfigScalingGroup api#875, still in review.Testing 🧪
How was this tested 👻
22 tests: the gate (including that a
regionIdalone does not open it), the matching order, exact-beats-catch-all, role following the active flag rather than arrival order, multiple groups per region, uncovered regions, and provider label fallbacks.count-strict-errors.tsreports 0.What comes next
Each slice is independently reviewable and each stays dark without regions:
Checklists
Merge Checklist