Skip to content

Assignments and leases during a break

This is the question a broken control plane link really asks: what happens to the work. The answer depends on how long the break lasts relative to the lease, and it is the same answer whether the node crashed, the network dropped, or the control plane went away.

The lease is the clock

lease life        30 seconds
renewal cadence   every 10 seconds
terminal grace    30 seconds after expiry, completion reports only

Three renewals fit inside one lease life. A single missed renewal is absorbed; a link down for more than 30 seconds costs the lease.

The three windows

gantt
  title One lease, measured from the last successful renewal
  dateFormat X
  axisFormat %M:%S
  section Lease
  Lease life, 30 s :active, life, 0, 30s
  Completion grace, completion reports only :grace, after life, 30s
  section Renewal cadence
  Last renewal :milestone, r0, 0, 0s
  Renewal due :milestone, r1, 10, 0s
  Renewal due :milestone, r2, 20, 0s
  section Break windows
  Absorbed, renewal resumes :w1, 0, 30s
  Lapsed, work requeued :crit, w2, 30, 30s
  Lease and grace gone :crit, w3, 60, 10s

Read a break by where its end falls on the bottom row. A break that ends in the first bar costs nothing; one that ends in the second has already lost the lease but can still land a completion; one that ends in the third has lost both.

Under the lease life. The node misses a renewal or two, the link returns, and renewal continues. Nothing was requeued, nothing changed hands, and the work carries on. This is the common case for a network blip.

Past the lease life. The lease lapses. The control plane's lease controller requeues the assignment on its next cycle, and the work becomes available to another node. The original node is still executing it, and does not yet know.

Past the grace window. Even a completion report from the original node is now refused.

What the original node is still doing

It keeps executing. The kernel link is unaffected and the work is local, so the step continues to completion regardless of the lease. The node discovers the outcome when it tries to report.

That discovery is a refusal, and which one tells it what happened:

Refusal Means
ASSIGNMENT_LEDGER_LEASE_EXPIRED The lease lapsed and no grace applies
ASSIGNMENT_LEDGER_FENCE_TOKEN_MISMATCH Another node has claimed it and holds the active fence
ASSIGNMENT_LEDGER_STALE_EPOCH The report was produced under a superseded control epoch
ASSIGNMENT_LEDGER_RESYNC_REQUIRED The node's position cannot be reconciled

The grace window exists for exactly this case

A completion report is accepted for 30 seconds past lease expiry. Work that finished just as its lease lapsed is recorded rather than lost.

Progress reports get no such grace. The asymmetry is the point: a late completion is information worth keeping, and a late progress report is a node acting without a lease.

What is guaranteed across the whole thing

One owner at a time. The fence is minted per claim, so only one node's reports are accepted for an assignment even while two believe they own it.

No lost terminal state. Either the original node reports within the grace window, or the reclaiming node runs the work and reports its own terminal state. The assignment reaches a terminal state either way.

No silent duplicate record. A displaced node's report is refused by name rather than merged, so the record has one author.

What is not guaranteed is that the work runs once. A non-idempotent step whose lease lapsed mid-execution can be executed twice, which is why the execution admission gate refuses a retry budget on a non_idempotent_write block in the first place. See Admission gates.

After the break

The node recovers its position by snapshot and delta rather than replaying history, and discovers which of its assignments it still owns. See Recovering the control plane link and The assignment ledger.