---
title: "The design - Live checkpoint advance: fenced redesign"
url: "https://nsta1.github.io/Orleans.Lattice/spec/wal/design/liveadvancedesign/the-design.html"
source: "https://github.com/NSTA1/Orleans.Lattice/blob/release/10.5/spec/wal/design/LiveAdvanceDesign.md?plain=1#L146-L184"
documents: "Orleans.Lattice 10.5.0 (release line 10.5)"
built: "2026-12-05"
all-pages: "https://nsta1.github.io/Orleans.Lattice/llms.txt"
---
# The design

Part of [Live checkpoint advance: fenced redesign](../LiveAdvanceDesign.md).

A leaf may advance a partition's checkpoint over its own applied appends only when
it can prove exclusive authorship of every entry it owns in the window it passes.
Whenever it cannot, it falls back to the replay-based advance, which reads and
applies every entry it owns. Three mechanisms supply the proof:
- an epoch fence against other activations of the same leaf;
- a hand-off fence against other writers;
- an unstamped watermark against writers that predate the fences.

All three are enforced at one seam: the WAL shard's offset assignment, under the
lock (`_stateGate`) that already makes the move fence (#4525) and the clock floor
(#4586) atomic with assigning an offset. A rejection there is retried where it is
raised, so no caller's contract changes (section 5).

**New state only in new rows.** Every piece of durable state the design adds lives
in its own row, under a reserved grain type, written through the tree's grain
storage provider. `GrainStorageFencingProbe` is the precedent. No existing state
type (`LeafNodeState`, `ShardRootState`, `WalShardFloorState`) gains a field. A
10.2.0 silo that rewrites one of those rows therefore cannot drop anything the
design relies on. See [Backward compatibility](backward-compatibility.md).

| Row (reserved grain type) | Key | Holds | Written by |
|---------------------------|-----|-------|------------|
| `_lattice_leaf-append-epoch` | Leaf id | The leaf's append epoch | Claims only, by conditional write |
| `_lattice_wal-append-epoch` | WAL shard key and leaf id | The partition's epoch entry for the leaf | The claim at the WAL shard (conditional max-merge), and entry retirement |
| `_lattice_wal-append-epoch-floor` | WAL shard key | The partition's retired-epoch floor | Entry retirement only (max-merge) |
| `_lattice_wal-routing-generations` | WAL shard key | The partition's generation table: a slot per shard-level initiator (a shard root, or the tree's range-delete fence), one row per partition (#5987; it replaced a per-initiator row before release) | The initiator's re-claim (a conditional read-modify-write raising its own slot and leaving the others as read), and retirement at the tree's purge (#5668) |
| `_lattice_leaf-handoff` | Leaf id | The leaf's hand-off marker: initialised flag, open tokens and per-partition close heads | Hand-off initiators, and the leaf's birth |
| `_lattice_shard-handoff` | Shard root id | The shard-level marker (the re-seed incarnation that seeded it (#5716), initialised flag, open tokens with their key ranges, close heads), the shard's routing generation, and each in-flight bulk operation's birth hint | The shard root, and the range-delete fence |
| `_lattice_tree-routing-floor` | Tree id | A map from initiator tag (`s{i}` for shard root i, `t0` for the range-delete fence) to that initiator's routing floor (#5668, #5703) | The purge (one write raising every initiator's floor, before any delete) and the re-seed catch-up (its own initiator only). Read by every first-generation initialisation and by `NextRoutingRetryAsync`'s floor check, and loaded by each WAL shard activation |
| `TreeRangeDeleteFenceGrain` state (a new grain type, not a reserved-type row) | Tree id | The tree's range-delete generation, and each open range-delete intent: operation id, range, recorded deadline, and the shards whose markers it opened | The range-delete fence grain only |

Each row's state type is new, carries a new stable alias, and is marked
`ILatticeBinaryPersistedState`. Every member is `[Id(n)]` and is a public property
of a concrete type: arrays and concrete dictionaries, never a collection expression
typed as an interface (#5579). The rows therefore also round-trip through a JSON
grain-storage serializer when a host bypasses Lattice's binary serializer.

## Contents

- [1. The epoch fence: other activations of the leaf to 2. The hand-off fence: other writers](the-design-1.md)
- [3. The bulk birth hint to 5. Rejections are retried where they are raised](the-design-2.md)

Next: [The design: 1. The epoch fence: other activations of the leaf to 2. The hand-off fence: other writers](the-design-1.md). Contents: [Live checkpoint advance: fenced redesign](../LiveAdvanceDesign.md).
