aboutsummaryrefslogtreecommitdiff
path: root/src/table/sync.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-03-11 19:30:24 +0100
committerAlex Auvolat <alex@adnab.me>2021-03-11 19:30:24 +0100
commit1ec49980ec876ef9395a9ae088f82d86a1a0d9f6 (patch)
tree1da6ba1614ede38e04b420e359452ab5ac741352 /src/table/sync.rs
parent3f7a496355bdbeeeee859912fa6fa7a95cb47f3b (diff)
downloadgarage-1ec49980ec876ef9395a9ae088f82d86a1a0d9f6.tar.gz
garage-1ec49980ec876ef9395a9ae088f82d86a1a0d9f6.zip
whoops
Diffstat (limited to 'src/table/sync.rs')
-rw-r--r--src/table/sync.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/table/sync.rs b/src/table/sync.rs
index f8ebb2f0..07d48155 100644
--- a/src/table/sync.rs
+++ b/src/table/sync.rs
@@ -370,6 +370,14 @@ where
must_exit: watch::Receiver<bool>,
) -> Result<(), Error> {
let root_ck = self.get_root_ck(partition.range)?;
+ if root_ck.is_empty() {
+ debug!(
+ "({}) Sync {:?} with {:?}: partition is empty.",
+ self.data.name, partition, who
+ );
+ return Ok(())
+ }
+
let root_ck_hash = hash_of(&root_ck)?;
// If their root checksum has level > than us, use that as a reference
@@ -637,7 +645,7 @@ fn join_ordered<'a, K: Ord + Eq, V1, V2>(
ret.push((&x[i].0, Some(&x[i].1), None));
i += 1;
} else if j < y.len() && (i == x.len() || x[i].0 > y[j].0) {
- ret.push((&x[i].0, None, Some(&y[j].1)));
+ ret.push((&y[j].0, None, Some(&y[j].1)));
j += 1;
} else {
unreachable!();