carlos / platform Public

db-pull-at

carlos db pull and carlos db query take --at <RFC 3339 time> and restore the instance's replica as it was at that time (#262).

  • dbdoor.RestoreAsOf sets litestream's Timestamp. The door lists S3 LastModified (upload time, second resolution, rounded down), so --at is rounded down to its second and a copy is never newer than --at. It can be a little older; the output names the transaction it stopped at.
  • Refuses a listing with no file times (the claim-mode door), which litestream would otherwise read as "before T" and answer with the newest copy.
  • A time before the kept history names the first second that works. Pre-epoch times (including Go's zero time) clamp to the epoch so they can't mean "newest".
  • --txid was considered and dropped: it only lands on exact file boundaries.

Copy: CLI strings and the docs/site/cli.md paragraph approved in copy review, unedited. Review: Astra two rounds, accepted. Gate green on 26c65c10; main merged at 40647969.

Reach: carlos db reads only sleeping instances, which keep about a day of history until #263 lands.

Commits 5
Discussions 0 0 open
Tasks 6/6 done

Discussions

  • No discussions on this branch yet.

Tasks 6/6 done

  • Check how litestream selects files for a timestamp restore Done
  • Thread --at through dbdoor (RestoreAsOf, tests first) Done
  • Add --at to carlos db pull and query, with plain out-of-range errors Done
  • Say the as-of point in dbAsOf output and usage Done
  • Gate, review (Astra), handoff Done

Activity