spec/DURABILITY.md's "Backups" says a snapshot of the data directory is a backup, and that starting on one is a rollback the server does nothing about, as the reference does nothing for a database brought back.
The consequences:
Reused seqs. The firehose numbers its next events from the backup's last seq, so seqs it sent before go out again for other events. A relay whose cursor is past them gets FutureCursor until the server catches up, and then reads events it takes for ones it has already seen.
Lost commits. Relays and AppViews hold commits the server no longer has. An account's next commit has a later rev, but its since and prevData name a commit those consumers never saw from the restored chain.
Handle changes made after the backup stay at the PLC directory, while the server holds the old handle.
What would fix it:
Restore is the operator's to say, by a flag or variable on the first start after a restore. The server cannot tell a restored directory from a normal restart.
On that start, jump seq past every one it could have sent: the last reserved block's end plus a margin, or a value taken from the time.
Tell consumers to resync. Emit #sync for every account, and #identity where its handle at the PLC directory differs from the one held, and settle the handle.
Harness: take a snapshot, write after it, start a server on the snapshot with the flag. The firehose must carry on with no seq reused, the #sync events must come, and a relay-like consumer must accept the next commits.
Not needed for a first deploy: a restore happens only after a disaster.
spec/DURABILITY.md's "Backups" says a snapshot of the data directory is a backup, and that starting on one is a rollback the server does nothing about, as the reference does nothing for a database brought back.The consequences:
seqs. The firehose numbers its next events from the backup's lastseq, soseqs it sent before go out again for other events. A relay whose cursor is past them getsFutureCursoruntil the server catches up, and then reads events it takes for ones it has already seen.rev, but itssinceandprevDataname a commit those consumers never saw from the restored chain.What would fix it:
seqpast every one it could have sent: the last reserved block's end plus a margin, or a value taken from the time.#syncfor every account, and#identitywhere its handle at the PLC directory differs from the one held, and settle the handle.seqreused, the#syncevents must come, and a relay-like consumer must accept the next commits.Not needed for a first deploy: a restore happens only after a disaster.