aboutsummaryrefslogtreecommitdiff
path: root/src/core/object_table.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-04-26 18:59:17 +0000
committerAlex Auvolat <alex@adnab.me>2020-04-26 18:59:17 +0000
commit0a283e4e70bbced6e1087df10e661a5a3d33289e (patch)
tree795aba9da84b7bafdf003fb01027c4be31e80945 /src/core/object_table.rs
parent9cb870f950504b142e2954d2e1eb76929aaf689f (diff)
downloadgarage-0a283e4e70bbced6e1087df10e661a5a3d33289e.tar.gz
garage-0a283e4e70bbced6e1087df10e661a5a3d33289e.zip
Fix deletion propagation
Diffstat (limited to 'src/core/object_table.rs')
-rw-r--r--src/core/object_table.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/core/object_table.rs b/src/core/object_table.rs
index 98e8d636..04f64fe7 100644
--- a/src/core/object_table.rs
+++ b/src/core/object_table.rs
@@ -163,11 +163,17 @@ impl TableSchema for ObjectTable {
if let (Some(old_v), Some(new_v)) = (old, new) {
// Propagate deletion of old versions
for v in old_v.versions.iter() {
- if new_v
+ let newly_deleted = match new_v
.versions
.binary_search_by(|nv| nv.cmp_key().cmp(&v.cmp_key()))
- .is_err()
{
+ Err(_) => true,
+ Ok(i) => {
+ new_v.versions[i].state == ObjectVersionState::Aborted
+ && v.state != ObjectVersionState::Aborted
+ }
+ };
+ if newly_deleted {
let deleted_version = Version::new(
v.uuid,
old_v.bucket.clone(),