Repository navigation
feat(relay): alert when a reserve-mode cell trips its dead-man - #27096
Conversation
7620a51 to
1a3a1a6
Compare
Rebased onto main as one commit after its parent squash-merged; kept both sides of the add/add list conflicts with #27024.
28f8289 to
e3c009f
Compare
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🔵 Low · up to 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 |
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
04e252d4-4618-4dee-81bb-0efd53bf1587
📒 Files selected for processing (4)
cloud/dev/fixtures/terraform-root-partition/families.jsoncloud/dev/scripts/relay-reserve-dead-man-alert.test.mjscloud/infra/terraform/relay-observability.tfcloud/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)" |
There was a problem hiding this comment.
🚀 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
…(--duplicate-assign-probes) Rebased onto main as one commit; kept both sides of the package.json test-list conflict with #27096.
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
orca_relay_cell_reserve_dead_man_tripped, keyed by cell. It counts the one line a cell writes when its dead-man trips.admitModeEffective=db, run the cell-flags workflow with--set admitMode=dbso Postgres records db and the sweeps resume.cellIdfield the cell writes. It is added topretest. The root-partition fixture lists the two new resources.Stacked on #27043, which adds the line and its
cellIdfield.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 -checkcleanApply 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) andorca_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.jsonandfamilies.jsonlines are resolved here. Merge #27024 first; until then this diff shows #27024's files too.