Skip to content

[Epic] P3 — Backup, Restore & PITR (v0.7) #166

Description

@habibtalib

Epic — v0.7 production-hardening, phase P3: Backup, Restore & PITR

Goal: an operator can take scheduled backups and restore to an exact point in time, verified.

High

  • PITR is inert scaffoldingexecute_restore, create_base_snapshot, WalArchiver, SnapshotCatalog have zero production callers; no base-snapshot task is scheduled; resolve_pitr always returns None. Reads as shipped but cannot be invoked. Replay also ignores PitrTarget.replay_lsn (no upper bound). storage/snapshot_executor.rs, storage/snapshot.rs:147-174, wal/archiver.rs:233-250 (filename parser also broken — expects wal-{first}-{last}.seg, real is wal-{lsn}.seg).

Medium

  • WAL-archive upload failures only warn!; truncation proceeds → hole in the archived stream → PITR continuity broken. checkpoint_manager.rs:214-217,336-388.
  • Hand-rolled UTC/leap-year math for PITR targets ("production should use chrono") → off-by-one → wrong LSN. snapshot_restore.rs:101-172.
  • Restore staleness gate bypassed on lock poisoning → stale envelope overwrites newer writes. backup/restore/mod.rs:80-97.
  • No restore verification (post-restore row-count/checksum reconciliation).
  • Backup is full-snapshot only — no incremental/differential, no scheduling/retention.

Success: scheduled base snapshots + WAL archiver wired; restore replays to a target LSN/timestamp; end-to-end "base + WAL → restore to T, assert state == state@T" test passes.

Tracked in .planning/v1-production-readiness/AUDIT.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions