Skip to content

feat(relay): alert when a reserve-mode cell trips its dead-man - #27096

Merged
Jinwoo-H merged 1 commit into
mainfrom
relay-step5-dead-man-alert
Oct 10, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
relay-step5-dead-man-alert

Conversation

@Jinwoo-H

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

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​69 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​69
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​261 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​260

ELI5

When a relay cell is running in the new "reserve" mode and stops hearing from the director that places desktops on it, it safely switches itself back to the old database mode. This PR makes that event raise an alert, so a person knows to finish the switch-back.

What Changed

  • New log-based metric orca_relay_cell_reserve_dead_man_tripped, keyed by cell. It counts the one line a cell writes when its dead-man trips.
  • New alert, "Orca Relay: reserve cell lost its placing director". It fires on any trip for a cell and goes to the usual relay notification channels. The runbook text explains how to respond: find out why placement stopped; then, once the cell reports admitModeEffective=db, run the cell-flags workflow with --set admitMode=db so Postgres records db and the sweeps resume.
  • A contract test ties the metric to the event name and the cellId field the cell writes. It is added to pretest. The root-partition fixture lists the two new resources.

Stacked on #27043, which adds the line and its cellId field.

Why

A tripped cell is live and still recorded as reserve in Postgres, so the sweeps keep skipping it until someone records db. Treating a cell as reserve only while it is heartbeat-live does not catch this case, because the cell is still live. A trip is latched to the switch-file generation and logged once, so a zero threshold has no noise source; that is why it notifies rather than staying in the console only, unlike #27024's switch-file alert.

Linked Issue

N/A (maintainer; relay step 5)

Visual Proof

N/A: alerting only, no UI.

Testing

  • node --test dev/scripts/relay-reserve-dead-man-alert.test.mjs dev/scripts/terraform-root-partition.test.mjs (9 pass); terraform fmt -check clean
  • Automated tests added/updated, or explained why not below

Apply only between rolls, with the owner's go: this is evidence code, so seal the next monitor after the merge.

Also alerts on orca_relay_cell_reregistration_gave_up, orca_relay_cell_reregistration_stalled (cells) and orca_relay_reserve_placement_off_with_reserve_cells (directors; also covers a partial rollback where one step-5 director keeps the dead-man from tripping), all notifying, pinned by the contract test.

Stacked on #27046 (the top of the step-5 chain) and merges #27024's branch, so their shared package.json and families.json lines are resolved here. Merge #27024 first; until then this diff shows #27024's files too.

@Jinwoo-H
Jinwoo-H changed the base branch from relay-step5-rollback to relay-step5-census October 10, 2026 02:39
Rebased onto main as one commit after its parent squash-merged; kept both sides of the add/add list conflicts with #27024.
@Jinwoo-H
Jinwoo-H force-pushed the relay-step5-dead-man-alert branch from 28f8289 to e3c009f Compare October 10, 2026 23:24
@Jinwoo-H
Jinwoo-H changed the base branch from relay-step5-census to main October 10, 2026 23:24
@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough
📝 Walkthrough
📝 Walkthrough

Walkthrough

The change adds four logging metrics and paging alert policies for relay reserve dead-man trips, flip-back registration give-ups and stalls, and director placement being disabled while reserve cells exist. It adds these resources to the Terraform inventory and adds tests that check their event fields, filters, labels, alert configuration, and notification channels. The pretest script now runs the new test file.





Priority: ➖ Normal

Merge Risk: 🔵 Low · up to e3c00

This adds relay alerts and tests, and carries little production risk. During a large flip-back failure, the free-text error labels on two metrics could cause metric throttling and missed alerts. Consider bounding those labels before or soon after merge.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
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 1…
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.
Title check Passed The title clearly identifies the primary change: adding an alert for a reserve-mode cell dead-man trip. It is concise and relevant, although the PR also adds related reserve-mode alerts.
Description check Passed The description is complete and focused. It explains the behavior, implementation, rationale, linked stacked changes, visual proof status, and test results. The maintainer exception explains the missi…

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR





  • 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: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 04e252d4-4618-4dee-81bb-0efd53bf1587
📥 Commits

Reviewing files that changed from the base of the PR and between 9029e84 and e3c009f.

📒 Files selected for processing (4)
  • cloud/dev/fixtures/terraform-root-partition/families.json
  • cloud/dev/scripts/relay-reserve-dead-man-alert.test.mjs
  • cloud/infra/terraform/relay-observability.tf
  • cloud/package.json

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

filter = "resource.type=\"gce_instance\" AND jsonPayload.event=\"orca_relay_cell_reregistration_stalled\""
label_extractors = {
cell_id = "EXTRACT(jsonPayload.cellId)"
reason = "EXTRACT(jsonPayload.reason)"

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.

🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win

Keep full error messages out of metric labels. Both events write error.message to reason. Distinct messages create distinct time series. During a large flip-back failure, Cloud Logging can throttle metric points and cause these alerts to miss events. Keep the message in logs, or emit a bounded reason code for the metrics. (docs.cloud.google.com)

  • cloud/infra/terraform/relay-observability.tf#L1745-L1745: remove the stalled metric’s full-message extractor or replace it with a bounded reason code.
  • cloud/infra/terraform/relay-observability.tf#L1679-L1679: make the same change to the give-up metric.
📍 Affects 1 file
  • cloud/infra/terraform/relay-observability.tf#L1745-L1745 (this comment)
  • cloud/infra/terraform/relay-observability.tf#L1679-L1679

@Jinwoo-H
Jinwoo-H merged commit 2895869 into main Oct 10, 2026
27 of 44 checks passed
Jinwoo-H added a commit that referenced this pull request Oct 10, 2026
…(--duplicate-assign-probes)

Rebased onto main as one commit; kept both sides of the package.json test-list conflict with #27096.
Jinwoo-H added a commit that referenced this pull request Oct 11, 2026
…(--duplicate-assign-probes) (#27107)

Rebased onto main as one commit; kept both sides of the package.json test-list conflict with #27096.
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