Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions bottomless/src/replicator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1095,13 +1095,17 @@ impl Replicator {
if let Ok(page_size) = Self::read_page_size(&mut db).await {
self.set_page_size(page_size)?;
}
// if database file exists always treat it as new and more up to date, skipping the
// restoration process and calling for a new generation to be made
return Ok(Some(RestoreAction::SnapshotMainDbFile));
Self::read_change_counter(&mut db).await.unwrap_or([0u8; 4])
}
Err(_) => [0u8; 4],
};

if local_counter != [0u8; 4] {
// if a non-empty database file exists always treat it as new and more up to date,
// skipping the restoration process and calling for a new generation to be made
return Ok(Some(RestoreAction::SnapshotMainDbFile));
}

let remote_counter = self.get_remote_change_counter(&generation).await?;
tracing::debug!("Counters: l={:?}, r={:?}", local_counter, remote_counter);

Expand Down