Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

Document and implement a snapshot (backup) strategy #70

Open
andrewjstone opened this issue Jan 13, 2017 · 4 comments
Open

Document and implement a snapshot (backup) strategy #70

andrewjstone opened this issue Jan 13, 2017 · 4 comments

Comments

@andrewjstone
Copy link
Contributor

The backend used by haret, vertree, supports snapshots. However, haret don't use them yet. There are a few strategies that we have discussed and that should probably be implemented.

  • Snapshot every N writes
  • Snapshot on admin user command
  • Snapshot every N seconds
  • Snapshot as fast as possible. As soon as the last snapshot completes, start another one.

We also need to decide:

  • How snapshotting is configured (config file, vs runtime, etc...)
  • What sort of retention policy for old snapshots we want (keep last 10, expire past 30 days, etc...)
@jrgarcia
Copy link
Contributor

I thought about this for a little bit and I think the best way to configure this would be through the configuration file. It wouldn't even look that bad given TOML. You could have a snapshot table or even an array of tables to configure multiple strategies. Being able to pass in configuration from the CLI would be nice, but I'm not sure it's desirable, at least initially.

I think those strategies take care of what almost everyone would use. Other than conditional snapshotting, I can't think of anything else. Conditional snapshotting brings in a whole other set of problems though.

@andrewjstone
Copy link
Contributor Author

andrewjstone commented May 19, 2017

I'm still not sure I want to add anything to the config file. Originally the goal for that file was only to allow bootstrapping of the node. All other configuration should be able to be set at runtime. That however, presents the problem that in order to save that runtime config it still needs to go somewhere. So yes, we could read and write to the config file, but that happens per node. Another alternative is to use a root consensus group for configuring these things. That way each node shares the configuration. The root consensus group will probably end up being created and used for creating namespaces also, to prevent collisions/race conditions if the same namespace is created on different nodes.

I'm actually not sure that we'll even need that much of a snapshot configuration like this anymore either. We are going to be adding a WAL that will be used log all operations, so snapshotting only needs to happen when the WAL gets garbage collected. Tuning that is going to be important, but it's tied together with logging so it's no longer just a 'snapshot' policy. I believe this issue was opened when we weren't thinking about logging to disk and just using the in mem log.

@jrgarcia
Copy link
Contributor

👍 makes sense

@evanmcc
Copy link
Contributor

evanmcc commented May 19, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants