You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(backup): per-tenant write-HLC high-water and restore staleness gate
Restoring an older backup into a cluster that has already committed
newer writes for the same tenant silently rolls those writes back.
This change introduces a per-tenant monotonic high-water mark on
SharedState that records the HLC wall-ns of every successful dispatch
and uses it in RESTORE to reject envelopes whose snapshot_watermark
predates the destination's observed write timeline.
SharedState gains a `tenant_write_hlc` map and an
`advance_tenant_write_hlc` helper that is called from every successful
dispatch path: gateway core, dispatch_utils, pgwire sync_dispatch, and
pgwire handler dispatch.
The backup orchestrator captures the envelope's `snapshot_watermark`
from `hlc_clock.now()` AFTER completing the per-node fan-out, so the
stamped watermark is guaranteed to be >= any tenant_write_hlc advanced
by the orchestrator's own dispatches. Envelopes with watermark == 0
(pre-feature backups) are passed through for compatibility.
0 commit comments