mirror of
https://github.com/stablyai/orca.git
synced 2026-09-29 16:02:50 +00:00
Copies the private repository's relay side: the IAM-only fence broker, the operations console and incident monitor, the relay Terraform root with its backend configuration and tfvars, and the deploy/capacity/admission/rehome/ monitoring scripts the workflows call, with their contract tests, contracts, and fixtures. The foundation and apps Terraform roots and the API and auth services stay private. Four surfaces that spanned both trees are narrowed to the relay side rather than left with a dangling read: the infra runner and the root-partition and workload-identity-condition renderers now declare only the relay root, and the Cloud SQL rollout census drops the six app workflows that are not here.
36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
const ASSIGNMENT_RETRY_DELAY_MS = 5_100
|
|
|
|
const waitPastAssignmentRateLimit = (schedule) =>
|
|
new Promise((resolve) => schedule(resolve, ASSIGNMENT_RETRY_DELAY_MS))
|
|
|
|
export async function proveRelayLoadRegionBehavior({
|
|
oldClientPeer,
|
|
stickyPeer,
|
|
asiaOrigin,
|
|
scheduleAssignmentRetry = setTimeout
|
|
}) {
|
|
try {
|
|
await oldClientPeer.connect()
|
|
if (!oldClientPeer.assignedCellUrl() || oldClientPeer.assignedCellUrl() === asiaOrigin) {
|
|
throw new Error('unhinted client did not use the US-first path')
|
|
}
|
|
} finally {
|
|
await oldClientPeer.shutdown()
|
|
}
|
|
|
|
try {
|
|
await stickyPeer.connect()
|
|
if (stickyPeer.assignedCellUrl() !== asiaOrigin) {
|
|
throw new Error('preferred Asia client did not reach the Asia cell')
|
|
}
|
|
await waitPastAssignmentRateLimit(scheduleAssignmentRetry)
|
|
const reassigned = await stickyPeer.requestAssignment('us-central1')
|
|
if (reassigned.cellUrl !== asiaOrigin) {
|
|
throw new Error('valid sticky assignment moved after preference changed')
|
|
}
|
|
} finally {
|
|
await stickyPeer.shutdown()
|
|
}
|
|
return { oldClientUsFirst: true, stickyAssignmentPreserved: true }
|
|
}
|