B1.5 · dive — the floor and the third clock
Hold, borrow, never re-issue.
Strict per-node monotonicity is not a property the layout grants; it is a property the clock discipline preserves. The mint floor is monotonic, as policy of record: when the wall clock steps backwards — an NTP correction, a VM migration — the minter holds at or borrows above its last-issued millisecond and never re-issues a past one. And a TTL is a third clock entirely: the store’s time, priced on the measured table and deliberately unmerged from the name’s.
Source: content/bcs1.5.md · the discipline and the third thing; the TTL price is Chapter 1.3’s measured row (bench/valkey-id/valkey_id_bench.out).
max(wall, last-issued) over the streams record’s milliseconds.The discipline the minter owes
content/bcs1.5.md · WhatWithin one millisecond the minting law already legislates: the counter excludes node bits, and a burst that drains the sequence borrows the next millisecond rather than a neighbor’s space. This dive states the wall-clock corollary as policy of record: the mint floor is monotonic — when the wall clock steps backwards (an NTP correction, a VM migration), the minter holds at or borrows above its last-issued millisecond and never re-issues a past one.
The policy has an operational half, and the chapter names it: the fleet operates with slewed corrections, monotonic sources, and the floor rule. Strict per-node monotonicity — the property the order theorem stands on — is preserved by this discipline, not granted by the bit layout.
The third clock: the store’s
content/bcs1.5.md · quoting valkey_id_bench.outA TTL is the store’s time — priced in Chapter 1.3 as embedded object growth and enforced by the engine’s clock at expiry. The name’s time is forever; the row’s tenure is rented. The price is on the measured table:
fmt keylen redis7 valkey81 saved
brd14 14 88 65 23
brd14+ttl 14 128 99 29 -- branded with EX 86400
Deliberately unmerged
content/bcs1.5.md · What + DecisionsRetention sweeps choose by id arithmetic; expiry executes by the store — two
mechanisms, deliberately unmerged. The sweep is identity time: a min_for cursor names the
cutoff and everything below it goes. The expire is the store’s time: the engine’s clock
ends the row’s tenure with no sweep in the loop. Merging them would put one clock’s
authority behind the other clock’s claims — the exact conflation the law of two clocks
exists to refuse.
The decisions of record this dive carries forward: the mint floor is monotonic, as policy of record — the minting law’s burst rule generalized to the clock itself, with the fleet discipline (slew, monotonic sources) named as its operational half; and the litmus governs here too — the store’s clock serves tenure questions, the id’s clock serves first-named questions, and neither substitutes for the other.
Where the store-side patterns live — keys, expiry, retention as a design surface — the applied course is Redis Patterns; the bus that carries the names between stores is EchoMQ.
References
sources · relatedSources
- Lamport — Time, Clocks, and the Ordering of Events in a Distributed Systemorder as a construction the clock discipline must preserve
- Valkey documentation — Streams introductionthe store-side arithmetic the retention sweeps ride
Related
- B1.5 — The Time Inside the Namethe module hub; the three clocks in context
- B1.3 — The ID Systemthe measured table the TTL row sits on
- B1.2 — The Identity Contractthe minting law whose burst rule the floor generalizes
- Redis Patterns Appliedthe store-side patterns, taught applied