Skip to main content

Module failover

Module failover 

Source
Expand description

A failover client: given all HA node addresses, connects to the current leader and transparently re-routes across a failover.

The leader is found by probing for the node whose 9P both accepts a connection and answers a sanity op (a standby is not serving; a fenced or lapsed leader fails the lease gate).

Retry safety (a prior design had a silent-duplication bug here). A retry-across-failover is safe two ways: naturally idempotent ops (read, and write = create+truncate), and idempotency op-ids for the non-idempotent mutating ops. Each op-id is generated ONCE per logical op (here, before the retry loop) and reused on every attempt, so the server recognizes a resend as already-applied instead of double-applying or spuriously EEXIST/ENOENT-ing.

Structsยง

FailoverClient
A client that connects to the current HA leader and transparently re-routes across a failover. See the module docs for retry-safety.