Skip to content

Commit 2e839a9

Browse files
committed
docs(webapp): document the mint-kind flip grace clock-domain assumption
The grace cutover compares the reader's wall clock against a DB-clock flippedAt stamp, so it assumes clock-synced hosts (skew well under the grace window). Records that invariant and the accepted residual on effectiveMintKind. No behavior change.
1 parent 98996c9 commit 2e839a9

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

apps/webapp/app/v3/runOpsMigration/mintFlipGrace.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ export type MintFlagResolution = {
1010

1111
const DEFAULT_MINT_KIND: RunIdMintKind = "cuid";
1212

13-
// Deterministic wall-clock cutover: during [flippedAt, flippedAt + graceMs) every
14-
// process — stale (hasn't re-read the flag) or fresh (has the new stamp) — resolves to
15-
// the OLD kind. At/after the cutover, every process resolves to the NEW kind.
13+
// Cutover boundary. `nowMs` is the reader's wall clock but `flippedAtMs` (in `r`) is DB-clock
14+
// (admin routes) — so this assumes NTP-synced hosts with skew << graceMs, letting every process
15+
// cross [flippedAtMs, flippedAtMs + graceMs) together (OLD then NEW). Accepted residual: a badly
16+
// mis-synced host can cross early/late and briefly reopen a skew-wide cross-DB duplicate window.
1617
export function effectiveMintKind(
1718
r: MintFlagResolution,
1819
nowMs: number,

0 commit comments

Comments
 (0)