Skip to content

TOC-111 Page for other nodes' outages once the nodes ahead go down - #68

Merged
jensenbox merged 2 commits into
mainfrom
TOC-111-reevaluate
Oct 28, 2026
Merged

jensenbox merged 2 commits into
mainfrom
TOC-111-reevaluate

Conversation

@jensenbox

Copy link
Copy Markdown
Member

What

A node in [federation] alert_order used to decide only once, when a push arrived, whether to page for another node's outage. If the node ahead was up at that moment, the outage was recorded with no alert, and nothing paged when that node went down later. Now the node decides again: once every node ahead is down and at least one is confirmed down, it opens alerts for the outages it holds open, alerted and unpaged.

  • Store::take_over (tocsin-store) opens alerts for open, alerted outages from other nodes that have no open alert yet. It skips this node's own outages and synthetic (node:/upstream:) subjects. Running it again does nothing.
  • takeover::take_over_when_ahead_is_down (tocsin) runs one pass at start. It runs again on every confirmed non-up change of a node ahead, after a reload, and after the event bus lags.
  • AlertOrder combines the alert_order logic that remote_alerting already used and the new takeover gate.
  • Late mark: a takeover's alert is late when the takeover happens more than a push plus grace after the check could have confirmed the outage. The hub heard about the outage on time but paged late, and the alert says so.
  • Unheard is not enough: a node ahead that has only gone unheard does not start a takeover. Right after a restart every node is unheard, and counting that would page for every open outage.

Unchanged

  • The TOC-110 gate for quiet nodes: takeover runs only on nodes listed in alert_order.
  • alerting_client() in serve.rs was pulled out of start_with to satisfy clippy's too_many_lines. It does not change behaviour.

Tests

  • Store: takeover opens one late alert for the open alerted outage. It skips the heartbeat, ended, own-node and wrong-node rows. A second run is a no-op, and the end change resolves the alert.
  • API, outage pushed while the node ahead is up: no alert until that node goes down, then exactly one alert, and the end push resolves it.
  • API, takeover long after the outage began: the alert is marked late.
  • API, node ahead goes down a second time: no second alert.
  • API, restart: the hub stops, node:first goes down while it is stopped, and the restarted hub takes over at start with no new push.
  • Mutation-checked: removing any of the following made a test fail: the open-alert skip, the opens skip, the own-node filter, the synthetic filter, the confirmed-down requirement, watches, the takes_over gate, the initial pass.
  • The reload trigger has no test of its own. It calls the same take_over as the initial pass.
  • Production trigger: a missed heartbeat reaches record through miss and emits the same CheckChanged as a ping.

https://claude.ai/code/session_01Ub1Bi7sFncPnpe2Cz4azBE

…(TOC-111)

A node in alert_order decided whether to page for another node's outage
only when the push carrying it arrived. An outage pushed while the node
ahead was up then went unpaged for good if that node died before it
ended. The node now decides again whenever a node ahead goes down: once
every node ahead is down and at least one is confirmed so, it opens
alerts for the other nodes' outages it holds open and alerted without
one, late-marked when the origin detected them long before. A node
merely unheard cannot start a takeover alone, so a restart pages for
nothing. Taking over is idempotent: an outage with an open alert is
skipped inside the write transaction.

Claude-Session: https://claude.ai/code/session_01Ub1Bi7sFncPnpe2Cz4azBE
Signed-off-by: Christian Jensen <christian@closient.com>
…ed (TOC-111)

Claude-Session: https://claude.ai/code/session_01Ub1Bi7sFncPnpe2Cz4azBE
Signed-off-by: Christian Jensen <christian@closient.com>
@jensenbox jensenbox added the enhancement New feature or request label Oct 28, 2026
@jensenbox
jensenbox merged commit e7783fa into main Oct 28, 2026
16 checks passed
@jensenbox
jensenbox deleted the TOC-111-reevaluate branch October 28, 2026 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant