support avoiding snapshots
This commit is contained in:
@@ -126,8 +126,21 @@ impl Replica {
|
||||
/// Synchronize this replica against the given server. The working set is rebuilt after
|
||||
/// this occurs, but without renumbering, so any newly-pending tasks should appear in
|
||||
/// the working set.
|
||||
pub fn sync(&mut self, server: &mut Box<dyn Server>) -> anyhow::Result<()> {
|
||||
self.taskdb.sync(server).context("Failed to synchronize")?;
|
||||
///
|
||||
/// If `avoid_snapshots` is true, the sync operations produces a snapshot only when the server
|
||||
/// indicate it is urgent (snapshot urgency "high"). This allows time for other replicas to
|
||||
/// create a snapshot before this one does.
|
||||
///
|
||||
/// Set this to true on systems more constrained in CPU, memory, or bandwidth than a typical desktop
|
||||
/// system
|
||||
pub fn sync(
|
||||
&mut self,
|
||||
server: &mut Box<dyn Server>,
|
||||
avoid_snapshots: bool,
|
||||
) -> anyhow::Result<()> {
|
||||
self.taskdb
|
||||
.sync(server, avoid_snapshots)
|
||||
.context("Failed to synchronize")?;
|
||||
self.rebuild_working_set(false)
|
||||
.context("Failed to rebuild working set after sync")?;
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user