From 2caa0b79e04722011814b1adf2a8a449b05799f2 Mon Sep 17 00:00:00 2001 From: Ignotus Peverell Date: Sun, 17 Dec 2017 21:24:43 +0000 Subject: [PATCH] Removed log should *always* be backed up before truncate --- store/src/sumtree.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/store/src/sumtree.rs b/store/src/sumtree.rs index 7d57bbd49..daf34710d 100644 --- a/store/src/sumtree.rs +++ b/store/src/sumtree.rs @@ -187,11 +187,12 @@ impl RemoveLog { // DEBUG let _ = self.flush_truncate(last_offs); + // backing it up before truncating + self.removed_bak = self.removed.clone(); + if last_offs == 0 { self.removed = vec![]; } else { - // backing it up before truncating - self.removed_bak = self.removed.clone(); self.removed = self.removed .iter() .filter(|&&(_, idx)| idx < last_offs)