PebbleDB snapshot? #3986
Replies: 2 comments 4 replies
Yes, for the moment. The primary goal of PebbleDB in v2.7.0 is to replace the file backend which does not have dedicated backup functionality either, so I'd deem the lack of this feature acceptable w.r.t. our current intent. Nevertheless:
is certainly not off the table as far as I'm concerned (cc @cipherboy?). Happy to take an issue / design proposal on how we might expose this functionality natively. |
|
Hi, I came up with a design proposal. I got a little help from AI putting this proposal together. Online snapshots for PebbleDBPebbleDB currently requires OpenBao to be stopped before its data directory can be safely copied. PebbleDB provides Add a temporary snapshot directory setting: storage "pebbledb" {
path = "/mnt/openbao/data"
snapshot_temp_dir = "/mnt/openbao/snapshot"
}
For each snapshot request, OpenBao generates a unique checkpoint path under The path must not already exist. OpenBao then calls: db.Checkpoint(snapshotDir)
The resulting checkpoint is streamed to the client as a Temporary checkpoint directories are removed when the snapshot operation completes or fails normally. If OpenBao terminates unexpectedly, a temporary checkpoint directory may be left behind. Such stale directories can be safely removed manually by the operator after confirming that no snapshot operation is using them. The API could follow the existing Raft snapshot API: For example: curl \
--header "X-Vault-Token: ..." \
http://127.0.0.1:8200/v1/sys/storage/pebbledb/snapshot \
> pebbledb-snapshot.tar.gzA CLI wrapper could expose this as: bao operator pebbledb snapshot save pebbledb-snapshot.tar.gzRestore does not initially require a dedicated API or CLI. It can remain a simple offline procedure:
Thanks! |
Uh oh!
There was an error while loading. Please reload this page.
I’m considering using PebbleDB, but does the procedure for taking a safe backup require stopping OpenBao?
Are there any plans to support backup and restore functionality similar to Raft?
Thanks for your help!
All reactions