Failure model
What happens to records and clients when a node, a zone, or a dependency fails, and how Nova tests it.
An acknowledged record survives the failure of any node, because it is in object storage before the acknowledgement. When a node fails, writes to the streams it led pause until another node takes over, about the metadata store's session timeout plus a second or two. Reads of indexed records continue throughout, from any node. This page says what each failure does, and how these claims are tested.
The parts
| Part | What it does |
|---|---|
| Session | A node's connection to the metadata store. Its leases end when it expires: 10 seconds after the last renewal with an external store, 15 seconds with the built-in one. |
| Ledger | The run of WAL slots one node wrote under one epoch |
| Cut | The first slot of a ledger that a fence blocked. Every slot below it that holds a flight is committed, and nothing at or above it can be. |
| Ledger recovery | Fences a stopped ledger and records in the metadata store where its records are |
| Retry budget | How long the SDK keeps retrying a call across failovers: 30 seconds |
When a node fails
A node's memory holds only copies of records that are already in object storage, plus batches it has not acknowledged. So a crash loses no acknowledged record. Recovery has two jobs: give the node's streams new leaders, and index what it acknowledged but had not yet absorbed.
- The failed node's session expires, and its leases end with it.
- The next producer to open one of its streams gets a new leader. A read that needs the end of one of its streams does not wait for a producer, and the auditor covers the streams nobody touches.
- The new leader runs ledger recovery on the failed node's ledger. It first fences the ledger: it copies any partly written slot to enough buckets, then writes a marker into the first empty slot, the cut. It then records where every record below the cut is. No record data moves.
- It deletes the slots above the cut, written but never acknowledged. It looks one full upload window past the cut to find them all.
- The new leader serves. The SDK resends the batches that were not acknowledged.
A slot that was committed before the crash is kept, even when its acknowledgement never reached the client. A plain append whose acknowledgement was lost is therefore stored twice after the resend. A batch with a match sequence number is refused instead, and the client learns that an earlier attempt may have been stored. Sequence numbers continue with no gap. See Writer coordination.
A node that only seemed dead, because it paused or lost its network, finds the marker on its next write and stops. A planned move needs none of this: the departing leader indexes its records before it releases the lease, and its successor has nothing to recover.
How long failover takes
Failover takes the session timeout plus the recovery after it. On a local three-node cluster, a crashed node's streams accepted appends on another node 0.5 to 2 seconds after its session expired. With the default timeouts, that is about 11 seconds after the crash with an external metadata store, and about 17 with the built-in one.
With the built-in store, a crash can take longer. When the failed node also led the metadata store's coordinator, the coordinator has to move before any of the node's metadata can. At the built-in store's default timeout, the same tests measured 25 to 32 seconds from the crash in that case. The common case fits in the SDK's 30-second retry budget. The slow case can exceed it, and then the application sees the error.
Reads follow the same timeline. A tail check, a read that reaches the end, a fence, and a subscription waiting at the end each run the recovery themselves once the session has expired. Until then they are sent to the failed node and fail, and the SDK retries them. A waiting subscription checks about once a second, so it can take a second longer. Streams the failed node did not lead are not affected, because a node that does not lead a stream sends the client to its leader at once.
The SDK remembers each stream's leader. A call that fails only because the caller's own deadline passed does not make it forget. It forgets the leader when that node says it no longer leads, cannot be reached, or times out three calls in a row.
Other failures
| Failure | What clients see | How Nova recovers |
|---|---|---|
| Object storage slows | Appends take longer, then wait as the limits fill | Resumes as writes complete. See Backpressure. |
| A slot cannot be written for 30 seconds | Appends wait | The node fences its own ledger, starts the next one, and writes the unacknowledged flights again |
| One availability zone fails, Express with three zones | Nothing. Appends are acknowledged at two copies of three. | Nothing to recover. Reads try another zone's bucket. |
| Two zones fail | Express appends wait | Writes resume when a zone returns |
| The metadata store is slow | Opens and lookups are slower. Appends wait once the backlog fills. | Absorb catches up, and the backlog drains |
| The metadata store is down for longer than the session timeout | Writes stop, and reads that need a lookup fail | Nodes lose their sessions and exit. When the store returns, restarted nodes rejoin and recover their streams as after a crash. |
| The auditor stops | Nothing | Storage grows until it runs again, then the due jobs run |
| A Gateway or object cache instance fails | Clients reconnect to another Gateway instance. Reads skip a failed cache instance. | Neither holds state that must be recovered. |
What the model does not cover
Object storage is where records are durable. Nova protects against losing nodes, not against losing objects: a record is as safe as the bucket that holds it, and an Express record is in two zones once acknowledged. The metadata store is the only index of where records are. Its own replication covers the loss of a server, and backups cover the loss of the whole store. See Backups and restore.
How Nova is tested
Nova checks these claims at three levels. Formal specifications check the protocols. Fault-injection tests check the code against real failures. A linearizability checker checks what clients observed.
Formal specifications
Eight TLA+ specifications describe the protocols, and the TLC model checker explores every state they can reach within set bounds:
| Specification | What it checks |
|---|---|
| Ledger | Slots written to K buckets and committed at W copies, then fenced. An acknowledged slot stays committed, nothing is acknowledged at or above the cut, and every fencer finds the same cut. |
| Stream leadership | Leases, the open gate, the clean-release mark, and ledger recovery. Every acknowledged record is indexed exactly once, with no gaps. |
| Plain stream | Fencing tokens, fence, trim, reconfigure, and delete, as clients see them |
| Scalable stream | Splits, merges, producer resends, and readers. Each key keeps its order, and a reader neither skips nor repeats records. |
| Range rows | A split run in steps, its intent, and cleanup after a crash |
| Registry | Bucket and stream rows under concurrent writers that crash between steps |
| Object lifecycle | Rewrites, two-stage deletes, orphans, and read plans. No ref points at a deleted object. |
| Membership | A node from start to retirement: drain, decommission, and cleanup after a crash |
Each defect the specifications found, and each design option they ruled out, is kept as a configuration with its guard switched off, and the checker must report the violation. These 64 configurations show that each guard is still needed, and that the specifications can still find the bug. The specifications are checked in CI whenever they or the API definitions change, and every week with a longer random search. A coverage ledger maps every API call to the specification that models it, or says why none does.
The specifications check the design, not the Go code. The tests below check the code.
Fault injection
On every pull request:
- Chaos tests run a node against storage that fails a share of writes and reads, with random restarts. Each failure is decided by hashing a seed with the call and its attempt number, so a failing seed replays the same faults whatever the timing. After healing, the tests check that no acknowledged record is lost, sequence numbers have no gaps, every record is exact, and no batch is stored in part.
- Integration tests run real
novadprocesses against an Oxia metadata store and S3-compatible storage. They kill, stop, pause, and restart nodes, and cut one node off from storage or from the metadata store through a proxy. Fault points built into test builds inject a fault at an exact step, such as losing an acknowledgement just before it is sent. - Crash-point tests stop each multi-step metadata change between every pair of steps and check that a re-run reaches the same result.
A longer acceptance suite runs the same kinds of faults, and splits and merges under load, on a three-node Docker cluster. It takes about two hours and is run by hand.
Linearizability
The tests record every append and read that concurrent clients make, with the time each started and ended. The Porcupine checker then searches for one order of all operations that explains every result. An append that failed counts as maybe applied, and the checker tries both cases. The strictest model requires that once an append is acknowledged, every later read sees it. A violation fails the test and saves a visual history of the operations. The checker runs under combined faults, leader kills, storage cuts, lost acknowledgements, and metadata store session expiry, and on each range of a scalable stream.
Go deeper
Ledger recovery
Every step of a takeover after a failure
Epochs and fencing
Why every fencer finds the same cut
WAL, slots and ledgers
What stops a ledger, and how the next one starts
For what an operator sees and does during these failures, see Failure modes. Back to the concepts: Guarantees.