Skip to content

Commit 8d1f11e

Browse files
committed
docs(metadata): the metadata.mutated receipt now retires the overlay-read cache too
#13609's bumpWriteEpoch call in applyRemoteMetadataMutation retires the sys_metadata overlay-row cache directly, on the same shared engine write epoch the authz.invalidated bridge already bumps. Two doc claims dated from before that fix and named authz.invalidated as the only non-local retirement path, with OS_METADATA_OVERLAY_CACHE_TTL_MS as the sole floor otherwise: - content/docs/concepts/metadata-lifecycle.mdx's cross-replica-sync note - content/docs/deployment/environment-variables.mdx's OS_METADATA_OVERLAY_CACHE_TTL_MS and OS_LOCALIZATION_CACHE_TTL_MS rows (the localization cache in packages/core/src/security/resolve-authz-context.ts reads the identical engine.writeEpoch seam, so it is retired by the same bump) Narrowed the lag claim to match: the TTL is now the floor only on a deployment with no cluster bridge attached at all (in-process `memory` driver), not on every deployment lacking the authz.invalidated bridge specifically. content/docs/kernel/cluster.mdx was flagged by the PR's own docs-drift-check bot (it names applyRemoteMetadataMutation) but makes no claim about the overlay-cache/write-epoch bound at all — left unchanged. No code, test, or changeset touched — the patch changeset already on this branch covers the behavior change; this is a documentation-only correction on top of it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68
1 parent 1f4b9d3 commit 8d1f11e

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

content/docs/concepts/metadata-lifecycle.mdx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,17 @@ The hash is `sha256:` + 64-hex of a canonical (sorted-keys, no-undefined) JSON s
190190
> before its own middleware chain runs, so read-your-writes is exact on the node
191191
> that made the write. A **peer's** write does not: `metadata.changed` invalidates
192192
> the MetadataManager caches this note is about, but it does not retire the
193-
> overlay-read cache. What retires that on a peer is the `authz.invalidated`
194-
> channel — a hint from another node bumps the local write epoch — or, failing
195-
> that, `OS_METADATA_OVERLAY_CACHE_TTL_MS` (default 30s, `0` disables the cache
196-
> outright). So on a deployment with no distributed cluster driver attached, a
197-
> peer's overlay re-read can lag a remote publish by up to that TTL. See
193+
> overlay-read cache. What retires that on a peer is either of two receipt
194+
> paths that bump the same local write epoch: the `metadata.mutated`
195+
> channel's own — `protocol.ts`'s `applyRemoteMetadataMutation` calls
196+
> `bumpWriteEpoch(engine, 'remote')` right after its registry converges and
197+
> before local listeners run (#13609, 2026-09-03) — or the `authz.invalidated`
198+
> channel's bridge, which bumps the same epoch for the authorization cache
199+
> and retires this one too, as a side effect of sharing it. Failing both, the
200+
> floor is `OS_METADATA_OVERLAY_CACHE_TTL_MS` (default 30s, `0` disables the cache
201+
> outright). So only on a deployment with no cluster bridge attached at all —
202+
> the in-process `memory` driver, with no distributed driver behind it — does
203+
> a peer's overlay re-read still lag a remote publish by up to that TTL. See
198204
> [Environment variables](/docs/deployment/environment-variables).
199205
200206
---

content/docs/deployment/environment-variables.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,8 @@ the hosted ObjectOS Cloud control plane.
361361
| `OS_SANDBOX_HOOK_TIMEOUT_MS` | number | `250` | Default **CPU-time** budget for a sandboxed **hook** body (QuickJS, ADR-0102): how much *VM-active* time a body may burn — idle host-await time and a nested hook's own run are NOT charged. A loaded/slow host rarely needs to raise this now (it is not wall-clock), but the knob remains. Only a positive integer is honored; unset / non-numeric / non-positive keeps the 250ms default. A hook body's own declared `timeoutMs` still wins over this. |
362362
| `OS_SANDBOX_ACTION_TIMEOUT_MS` | number | `5000` | Default **CPU-time** budget for a sandboxed **action** body (QuickJS). Same resolution rules as the hook variant above (positive integer only; an action body's own `timeoutMs` still wins). |
363363
| `OS_SANDBOX_WALL_CEILING_MS` | number | `30000` | Wall-clock ceiling (ADR-0102) — the backstop that cuts a hook/action body stuck on a host call that never settles (which burns no CPU, so the CPU budget alone would never fire). The effective ceiling is `max(this, cpuBudget)`, so it can never cut a body still inside its CPU budget. Positive integer only; unset keeps 30s. |
364-
| `OS_LOCALIZATION_CACHE_TTL_MS` | number | `30000` | Staleness bound, in milliseconds, for the cross-request cache of a workspace's reference localization (`timezone` / `locale` / `currency`, read from `sys_setting`) — leg C of #11633. `0` means **off**, a real path that restores the uncached query pattern exactly. Unlike `OS_AUTHZ_GRANTS_CACHE_TTL_MS` (which is off by default) this one ships **on**, because its invalidation is synchronous and in-process rather than TTL-bound: a `localization` settings change and any engine write both retire a cached answer immediately, so the TTL only bounds what neither seam can see — a write made on another replica with no `authz.invalidated` bridge attached. ⚠️ A malformed value reads as `0` (off), the opposite arm from the grants variable and deliberately so: there `0` is also the default, whereas here folding `3OOO` (letter O) into the default would hand you a **longer** window than the one you were setting. Deployment config only — never a settings row, because `sys_setting` is the table this cache caches. |
365-
| `OS_METADATA_OVERLAY_CACHE_TTL_MS` | number | `30000` | Staleness bound, in milliseconds, for the cross-request cache of the `sys_metadata` overlay read inside `getMetaItems` — leg D of #11633. `0` means **off**, a real path that restores the uncached query pattern exactly. Ships **on**, for the same reason as `OS_LOCALIZATION_CACHE_TTL_MS`: invalidation is synchronous and in-process, because every `sys_metadata` write goes through the engine and so advances the write epoch that retires the entry before the next read. What is cached is the overlay ROW SET only — never the merged answer — so the SchemaRegistry, the MetadataService and the artifact table are re-consulted on every call, cached or not, and the read-side registry hydration keeps running on a cache hit. The TTL therefore bounds one thing: a write made on **another replica** with no `authz.invalidated` bridge attached. ⚠️ A malformed value reads as `0` (off) — same arm and same reason as `OS_LOCALIZATION_CACHE_TTL_MS`. Deployment config only, never a settings row. |
364+
| `OS_LOCALIZATION_CACHE_TTL_MS` | number | `30000` | Staleness bound, in milliseconds, for the cross-request cache of a workspace's reference localization (`timezone` / `locale` / `currency`, read from `sys_setting`) — leg C of #11633. `0` means **off**, a real path that restores the uncached query pattern exactly. Unlike `OS_AUTHZ_GRANTS_CACHE_TTL_MS` (which is off by default) this one ships **on**, because its invalidation is synchronous and in-process rather than TTL-bound: a `localization` settings change and any engine write both retire a cached answer immediately, so the TTL only bounds what neither seam can see — a write made on another replica with no cluster bridge attached at all: neither the `metadata.mutated` channel's receipt path (`applyRemoteMetadataMutation` calls `bumpWriteEpoch`, #13609) nor the `authz.invalidated` bridge, both of which bump this same epoch when attached. ⚠️ A malformed value reads as `0` (off), the opposite arm from the grants variable and deliberately so: there `0` is also the default, whereas here folding `3OOO` (letter O) into the default would hand you a **longer** window than the one you were setting. Deployment config only — never a settings row, because `sys_setting` is the table this cache caches. |
365+
| `OS_METADATA_OVERLAY_CACHE_TTL_MS` | number | `30000` | Staleness bound, in milliseconds, for the cross-request cache of the `sys_metadata` overlay read inside `getMetaItems` — leg D of #11633. `0` means **off**, a real path that restores the uncached query pattern exactly. Ships **on**, for the same reason as `OS_LOCALIZATION_CACHE_TTL_MS`: invalidation is synchronous and in-process, because every `sys_metadata` write goes through the engine and so advances the write epoch that retires the entry before the next read. What is cached is the overlay ROW SET only — never the merged answer — so the SchemaRegistry, the MetadataService and the artifact table are re-consulted on every call, cached or not, and the read-side registry hydration keeps running on a cache hit. The TTL therefore bounds one thing: a write made on **another replica** with no cluster bridge attached at all — neither the `metadata.mutated` channel's own receipt path (`applyRemoteMetadataMutation` calls `bumpWriteEpoch` right after registry convergence, #13609) nor the `authz.invalidated` bridge, either of which retires this entry the moment it is attached and fires. ⚠️ A malformed value reads as `0` (off) — same arm and same reason as `OS_LOCALIZATION_CACHE_TTL_MS`. Deployment config only, never a settings row. |
366366
| `OS_INLINE_SEED_BUDGET_MS` | number | `8000` | Time budget for synchronous seed execution at boot before deferring to a worker. |
367367
| `OS_TENANT_AUDIT` | flag | `1` | Set to `0` to silence the tenant-isolation audit warnings emitted by the SQL driver. |
368368

0 commit comments

Comments
 (0)