Repository navigation
TOC-80 Remote nodes on the hub's page, API and alerts - #64
Merged
Merged
Conversation
A receiver in alert_order fires and resolves alerts for outages other nodes push, opening new ones only while every node ahead of it is down by its node:<id> liveness heartbeat. An outage received already ended pages no one; one received open but late fires and its messages say when the origin detected it (alert.arrived_late_at, migration 0021). Heartbeats tocsin keeps (node:, upstream:) never page from a push. The nodes API and the internal board show each remote node's liveness and its checks, with health and since null (unknown) whenever the node is not heard from within push_interval plus grace: never a stale up. Claude-Session: https://claude.ai/code/session_01Ub1Bi7sFncPnpe2Cz4azBE Signed-off-by: Christian Jensen <christian@closient.com>
…ssage (TOC-80) - The node that pushed a batch counts as up in the alert_order gate: its liveness beat is recorded only after the batch, so its first push read it as unheard and the next node opened duplicate alerts. - "Reported late" names when the origin detected the outage (the outage's start, not the alert's, which a re-fire keeps) and appears on resolves too, as docs/alerting.md says. - Behind a node that is up, clear the targets outright: fire_alerts re-fires every open alert whatever the targets. - docs/alerting.md no longer claims a returning hub skips what its backup already paged for; nodes do not share what they sent. Claude-Session: https://claude.ai/code/session_01Ub1Bi7sFncPnpe2Cz4azBE Signed-off-by: Christian Jensen <christian@closient.com>
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.
Follow-up 6 of
docs/design/federation.md: remote nodes on the hub's page, API and alerts.What changes
[federation] alert_orderfires an alert for an outage another node pushes, and resolves it with the same identity when the push says it ended. It opens a new alert only while every node ahead of it in the list is down by itsnode:<id>liveness heartbeat (unheard counts as down). Behind a node that is up it re-fires only alerts it already fired.push_intervalandgraceafter the origin detected it fires, and every message says Reported late with the origin's detection time. Stored asalert.arrived_late_at(migration 0021).node:<id>,upstream:<id>) never page from a push; each node watches those itself.GET /api/v1/federation/nodesgainslivenessandchecksfor every node but this one: each check'shealth,sinceandlast_result_at, withhealthandsincenull whenever the node's liveness is not up. The internal board lists the same nodes. The window is the liveness heartbeat, so the page and the alert gate use one signal.alerting.md(new "Other nodes' outages"),api.md,storage.md, the design doc.schema/openapi.jsonregenerated. The CLI tests' schema version moves to 21.Migrations
0020 (from TOC-81) and 0021 ride the next release, which is unreleased and needs Christian's go-ahead to tag.
Out of scope
nodesplacement and the quorum merge intostatus::checksare follow-up 9 (TOC-83). Until then every node runs every check, so remote state is shown per node rather than merged into the hub's own check list.alert_orderstill pages for its own checks, which the design says it should not. Filed as TOC-110; harmless while no spoke has notifiers.Acceptance (from the ticket)
unknown, notup:federation_tests::a_remote_check_reads_unknown_while_its_node_is_not_heard_from(API and board, with the node down and never heard from).an_outage_received_already_ended_alerts_no_one(store),a_pushed_outage_that_already_ended_pages_no_one(route).a_pushed_outage_fires_and_its_end_resolves_the_same_alert.alert_orderalerts only while the first is down by its liveness:a_pushed_outage_pages_only_while_every_node_ahead_is_down,behind_a_node_that_is_up_a_pushed_outage_opens_no_alert.an_outage_that_arrived_late_says_when,a_pushed_outage_that_reaches_the_hub_late_says_so. Heartbeat exemption:a_pushed_outage_of_a_heartbeat_tocsin_keeps_pages_no_one.I checked the tests bite: with the ahead-is-down gate, the already-ended skip, the late computation, the heartbeat exemption, and the liveness filter on remote checks each undone, the matching test failed.
Local:
cargo fmt --check, clippy with and withouttocsin/grpc, and the full workspace test run all pass.After review
A medium-effort code review found ten things. Fixed in 4242a2d:
alert_orderthat was not yet heard let the next node open duplicate alerts. The node that pushed now counts as up. New test:the_node_that_pushed_counts_as_up_before_its_heartbeat_is_heard.started_at, so the notice gave the wrong detection time and delay. It now uses the start of the outage the alert last fired for (StoredAlert.outage_started_at_ms, read through the outage row; no schema change), carried asAlert.late.retainbehind a node that is up wastargets.clear()in effect, sincefire_alertsre-fires every open alert regardless; it is now written that way.alert_orderdoes page again for an outage still open when it returns. The doc now says that.Each new or changed test was checked to fail with its fix undone.
Filed rather than fixed here: an outage pushed while the node ahead was up never pages if that node then goes down (TOC-111). Re-evaluating open remote outages when a node's liveness changes is its own piece of work and sits under the second-hub milestone.
Declined:
node:Cliveness heartbeat (TOC-81) goes down and pages. The outage itself is not paged, but the partition is, and that is the signal to act on.Routerbuilt per push. Only pushes carrying an open alerted outage build one, and it reads the live config. That path is rare enough that sharing serve.rs's router is not worth the coupling now.Local:
cargo fmt --check, clippy with and withouttocsin/grpc, OpenAPI unchanged, and the full workspace test run all pass.https://claude.ai/code/session_01Ub1Bi7sFncPnpe2Cz4azBE