Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

storage snapshots #8

Open
carlsverre opened this issue Sep 11, 2023 · 0 comments
Open

storage snapshots #8

carlsverre opened this issue Sep 11, 2023 · 0 comments
Assignees

Comments

@carlsverre
Copy link
Contributor

carlsverre commented Sep 11, 2023

With the rebase sync architecture, compacting the storage log is very easy and safe. At any point the coordinator can snapshot and start a new log from the snapshot.

The snapshot algorithm can work like this to improve efficiency on the clients:

  • coordinator snapshots the log at a particular LSN
  • appends a "end log" message to the previous log which contains the new log id and a hash of the snapshot
  • upon receiving this marker, a client can run the snapshot process locally and check that it gets the same snapshot
  • if it does, the client knows it can create a new local storage log from that snapshot and continue delta replicating from the server
  • if anything goes wrong, the client can drop their storage log and download the full snapshot from the server

This algorithm depends on the server continuing to serve the old log for some period of time - this time window determines how many clients will be able to efficiently switch over.

Since the coordinator also wants to be durable in a serverless setting, it's likely that the old logs will already be backed up to storage. Thus the coordinator can always serve from the last log lazily without keeping it in memory. (at least until GC runs and kills old logs, but that should never hit the immediately previous log)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Planning
Development

No branches or pull requests

1 participant