2.4 Ownership Models: Who Controls What, and When?

Concurrent autonomous workers make runtime ownership unusually important. It is not enough to know which service owns a responsibility. When several workers may encounter the same work, the system must also represent who currently holds a claim, and when that claim ceases to matter. MAGE treats ownership across time as a distinct model class.

DocAble represents work that has been claimed but not yet completely merged using an in-flight lease. At the model level the important facts are few: the work item, its current owner, an epoch that distinguishes one claim from another, the lifetime of the lease, and release or reclamation.

MODEL CARD

In-flight lease · Ownership

Figure 2.4-1 draws the resulting ownership model. A claim installs an owner, an epoch, and a lifetime; a merge releases it; expiry makes the work reclaimable. The representation suppresses the machinery that realizes ownership — it need not describe Redis operations, database transactions, worker processes, broker delivery, or merge implementation to answer who currently appears to own this work, and when may the system treat that ownership as stale?

In-flight ownership: CLAIMED releases on merge or becomes reclaimable on expiry A claim opens the CLAIMED state, carrying owner, epoch, and expires_at. Two transitions leave it. Merge releases the claim to a RELEASED outcome. Expiry moves it to RECLAIMABLE, a lapsed state from which another actor may claim it again. The model distinguishes a live claim from a stale one and states when the window has lapsed, without representing the storage machinery that implements the lease. IN-FLIGHT OWNERSHIP claim CLAIMED owner · epoch · expires_at merge expiry RELEASED claim ends cleanly RECLAIMABLE lease lapsed / stale another actor may claim Merge releases the claim; expiry makes it reclaimable. A live claim is distinguishable from a stale one — expiry is a state, not an accident.
Figure 2.4-1. In-flight ownership model. A current claim records owner, epoch, and lifetime. Merge releases the claim; expiry makes it reclaimable. The model distinguishes a live claim from a stale one without representing the storage machinery that implements the lease.

The model also exposes an important distinction. The lease helps the system represent active ownership and recover work whose apparent owner has disappeared. It is not the final authority for performing a consequential side effect. Durable compare-and-set logic underneath the lease prevents a stale claimant from repeating an already-authorized effect. A slow worker may therefore lose its lease and cause the work to be redelivered without allowing the new claimant to repeat an already-authorized effect.

The difficult ownership failures do not necessarily appear in any one transition. They emerge from interleavings. Suppose one worker holds epoch 7, appears stale, and is reclaimed; another worker receives epoch 8; then the original worker wakes and attempts a late release using its old claim. Every individual action may be locally reasonable. The engineering question is whether their composition can destroy the current owner's lease or otherwise leave the system in an invalid state.

The ownership model reduces that question to a finite state space: owner, epoch, lifecycle state, reclaim, and release are the relevant variables and moves. The implementation may involve databases, queues, Lua, workers, and timers, but those details need not all enter the model. The reduction lets us explore directly the interleavings that can preserve or violate the ownership property. Figure 2.4-2 follows one such sequence to the fork an epoch fence closes.

Why ownership becomes an interleaving problem A vertical state trace. Worker A owns epoch 7. Its lease appears stale, so the system reclaims it and issues epoch 8 to worker B. Worker A is still alive and wakes to attempt a late clear with its old epoch 7. Without an epoch fence, that stale clear may clear worker B's current lease, a forbidden outcome. With an epoch fence, the stale clear is inapplicable to the current claim and becomes a no-op. worker A owns epoch 7 reclaim + issue epoch 8 to worker B worker A attempts late clear(epoch 7) lease appears stale A is still alive without epoch fence may clear B’s current lease ✗ with epoch fence stale clear is a no-op ✓
Figure 2.4-2. Why ownership becomes an interleaving problem. Reclaim and reissue can overlap a stale holder's late release. An epoch fence makes the old holder's release inapplicable to the current claim.

Recovery is not permission. That distinction will matter in Part III: the same represented state can support different authority decisions.

The lease also shows that model classes overlap. Active leases can be counted to estimate demand, so the same representation contributes to an ownership question — who controls this work? — and a measurement question — how much work is genuinely in flight? Figure 2.4-3 draws that overlap: one represented fact fanning out into ownership, behavioral, and measurement views. The categories in this Part classify engineering questions, not mutually exclusive data structures.

One shared lease state answers ownership, behavioral, and measurement questions A single shared lease state, carrying owner, epoch, and lifetime, sits at the top and fans down to three purpose-views: ownership, who owns it; behavioral, when is it stale; and measurement, how many are active. One represented state, several engineering questions. Model classes distinguish purpose, not storage objects. SHARED LEASE STATE owner · epoch · lifetime OWNERSHIP who owns? BEHAVIOR when stale? MEASUREMENT how many active? One represented state, several engineering questions.
Figure 2.4-3. Model classes overlap. The same lease state supports ownership, behavioral, and measurement questions. The classes distinguish purpose, not storage objects.

The next chapter turns from who holds the work to who is permitted to act — the declared decisions a system makes about which of its parts may reach which.

© James C. Davis, 2026–present