Skip to content

docs(relay): director Cloud SQL sidecar enablement and rollback - #27461

Merged
Jinwoo-H merged 2 commits into
mainfrom
relay-director-sidecar-runbook
Oct 11, 2026
Merged

Jinwoo-H merged 2 commits into
mainfrom
relay-director-sidecar-runbook

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 0 0 0 0
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​43 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​43

ELI5

This writes down, in the relay operations guide, how to switch the relay director to the database proxy sidecar from #27406 and how to roll it back. Staging ran it on 2026-10-11, and two steps from #27406's description turned out to be wrong.

What Changed

A new Director Cloud SQL transport (proxy sidecar) section in cloud/docs/orca-relay-operations.md, with these corrections:

  • The 0% revision is never started. The 0%-traffic revision the Terraform apply creates is not started by Cloud Run: it shows Ready/Retired and logs nothing. fix(relay): director reaches Cloud SQL through a proxy sidecar (staging), adoptable deploy shape, event-loop stall alert #27406's step 5 said Cloud Run starts it once. The first real sidecar boot is the deploy's selector-rollback candidate, health-checked before any traffic moves.
  • Metric before alert. The new log-based metric must exist before its alert policy. On staging the first apply failed on the policy with 404 Cannot find metric(s), and a separate apply a few minutes later succeeded.
  • Rollback is now documented, including that no workflow owns the traffic move.

Why

The sequence lived only in the merged PR's description, and two of its claims were wrong. Production enablement should follow what actually happened on staging.

Linked Issue

N/A (internal relay follow-up).

Visual Proof

N/A: documentation only.

Testing

N/A: documentation only. Every claim comes from the staging enablement on 2026-10-11:

  • the apply log
  • revision orca-cloud-relay-staging-00080-xrw's conditions
  • deploy run 38135826245
  • the proxy logs on 00177-qur

AI Disclosure

N/A (internal contributor).

Agent skill upstream boundary

  • Not applicable.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • N/A: no UI
  • Self-reviewed
  • N/A: cross-platform
  • N/A: docs only

…un on staging

The 0% apply revision is not started by Cloud Run, so the first sidecar boot is the deploy's
rollback candidate. A new log-based metric can take minutes to appear, so its alert policy
can fail the first apply. Both observed on staging 2026-10-11.
@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d126d7df-fbfc-4a44-9bf2-5920dec336e1

📥 Commits

Reviewing files that changed from the base of the PR and between dc0ebe2 and a3867c3.


📒 Files selected for processing (1)
  • cloud/docs/orca-relay-operations.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.



📝 Walkthrough

Walkthrough

Adds a production runbook for moving the director from Cloud Run’s built-in /cloudsql socket to a Cloud SQL Auth Proxy sidecar. It documents Terraform prerequisites and targets, metric and alert creation order, deployment and serving-revision checks, and rollback to the retained pre-sidecar revision.


Priority: ⬇️ Low

Merge Risk: 🟡 Moderate · up to a3867

The production rollout cannot be executed reliably from the runbook as written; document the required rehome-generation and predecessor-digest inputs before merging.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check Passed The title clearly identifies the documentation change: Cloud SQL sidecar enablement and rollback for the relay director.
Description check Passed The description covers the change, rationale, testing basis, visual-proof exception, AI disclosure, scope, and checklist. The empty Review section and omitted Notes section are minor gaps, but the des…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 3


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0fc32206-4142-489d-80fd-b0d364ccfec6
📥 Commits

Reviewing files that changed from the base of the PR and between 4468a53 and dc0ebe2.

📒 Files selected for processing (1)
  • cloud/docs/orca-relay-operations.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Comment thread cloud/docs/orca-relay-operations.md Outdated
Comment on lines +477 to +480
1. Plan with exactly these targets and review it: `google_cloud_run_v2_service.relay`, the three
`relay_director_database_url` resources (secret, version, accessor),
`google_logging_metric.relay_event_loop_stall` and
`google_monitoring_alert_policy.relay_event_loop_stall`. Expect `5 to add, 1 to change`. The

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use complete Terraform target addresses.

The three relay_director_database_url entries are not valid Terraform target addresses. Replace them with the declared resource addresses, such as google_secret_manager_secret.relay_director_database_url, google_secret_manager_secret_version.relay_director_database_url, and google_secret_manager_secret_iam_member.relay_director_database_url_accessor. Otherwise, an operator cannot run the documented targeted plan as written.

Comment on lines +491 to +494
4. Dispatch the director deploy workflow with the **serving** image digest,
`shape-baseline-revision=<that revision>` and `confirmation=ADOPT_RELAY_DIRECTOR_TERRAFORM_SHAPE`.
The deploy compares its candidates with that revision's shape instead of the serving one, and
refuses an image change, an identity bootstrap, a topology change or pruning in the same run.

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Document all required workflow inputs.

When an operator supplies only the serving digest, shape-baseline-revision, and confirmation, the director workflow still lacks required inputs. The production workflow requires additional placement, reserve, shadow-cell, pruning, rehome-generation, bootstrap, and predecessor values. Dispatch can therefore fail input validation.

Suggested fix
--- "a/cloud/docs/orca-relay-operations.md"
+++ "b/cloud/docs/orca-relay-operations.md"
@@ -488,8 +488,12 @@
 3. The apply creates a 0% revision (the service declares no traffic block). Cloud Run does **not**
    start it: it reads `Ready` with reason `Retired` and logs nothing, so it proves the template
    parses, not that the sidecar boots. Record its name; it is `status.latestCreatedRevisionName`.
-4. Dispatch the director deploy workflow with the **serving** image digest,
-   `shape-baseline-revision=<that revision>` and `confirmation=ADOPT_RELAY_DIRECTOR_TERRAFORM_SHAPE`.
+4. Dispatch the director deploy workflow with all required inputs. Set
+   `image-digest` to the **serving** image digest,
+   `shape-baseline-revision=<that revision>`, and
+   `confirmation=ADOPT_RELAY_DIRECTOR_TERRAFORM_SHAPE`. Also provide the
+   required `regional-placement`, `reserve`, `shadow-cell`, `pruning`,
+   `rehome-generation`, `bootstrap`, and `predecessor` inputs.
    The deploy compares its candidates with that revision's shape instead of the serving one, and
    refuses an image change, an identity bootstrap, a topology change or pruning in the same run.
    The first real sidecar boot is the deploy's `selector-rollback` candidate, health-checked before

Comment on lines +502 to +506
Rollback: the pre-sidecar revision survives (shape adoption refuses pruning) and keeps its own
`/cloudsql` connection and socket secret, so `gcloud run services update-traffic <service>
--to-revisions=<pre-sidecar revision>=100` restores it. No workflow owns that move; in production it
needs approval and the rollout lease. The next deploy then refuses until a reviewed apply with the
variable `false` and a deploy that adopts that apply's revision.

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

The rollback note claims a deploy guard that does not exist.

The production workflow accepts an empty baseline input. When the input is empty, directorShapeBaseline uses the current serving revision instead of refusing the deploy. An operator can therefore dispatch a later deploy without applying Terraform with the sidecar variable set to false.

This can cause the deploy to adopt the rolled-back pre-sidecar revision as its baseline while Terraform still describes the sidecar shape. The runbook should not state that the next deploy refuses. It should document the actual prerequisite or add an explicit guard.

@Jinwoo-H
Jinwoo-H merged commit ea61d1c into main Oct 11, 2026
22 checks passed
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.

1 participant