Details
-
Improvement
-
Resolution: Unresolved
-
Major
-
Morpheus
Description
When a vBucket becomes/stops being active KV will be responsible for calling a Magma API provides which will inform it of this, e.g.:
struct BackupFile {
|
std::string name;
|
uint64_t len;
|
uint48_t low_seqno, high_seqno;
|
};
|
|
using MetadataWriterFn = std::function<void(std::string&)>;
|
using ContinuousBackupCb = std::function<void(KVStoreID kv_id, Magma::Snapshot& snapshot, std::vector<BackupFile>& new_files, MetadataWriterFn writer_fn)>;
|
|
void Magma::StartBackup(KVStoreID kv_id, const std:string& cont_bk_path, ContinuousBackupCb cb);
|
void Magma::StopBackup(KVStoreID kv_id);
|
When StartBackup is called Magma should hard link all existing seqno index files to cont_bk_path and call the provided callback with the files that were linked. Every continuous backup interval further files should be hard linked and the callback invoked again. This should continue until StopBackup is called.
When MetadataWriterFn is called it should serialise the string to a new file metadata.<n>.dat in the continuous backup location, where <n> is a monotonically increasing integer.