aboutsummaryrefslogtreecommitdiff
path: root/src/table/data.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-10-28 12:49:37 +0200
committerAlex Auvolat <alex@adnab.me>2021-11-08 15:47:44 +0100
commitcc255d46cdde707e6dec3e9a12ee4cd1ea484046 (patch)
treedfb988c3da081872c0640908699c600aa1ebd11a /src/table/data.rs
parent8e25a37f0e1d0b2584b3de2439df47f6b47e4d4c (diff)
downloadgarage-cc255d46cdde707e6dec3e9a12ee4cd1ea484046.tar.gz
garage-cc255d46cdde707e6dec3e9a12ee4cd1ea484046.zip
Refactor and comment table GC logic
Diffstat (limited to 'src/table/data.rs')
-rw-r--r--src/table/data.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/table/data.rs b/src/table/data.rs
index ffd494d5..13ec62bf 100644
--- a/src/table/data.rs
+++ b/src/table/data.rs
@@ -12,6 +12,7 @@ use garage_util::error::*;
use garage_rpc::system::System;
use crate::crdt::Crdt;
+use crate::gc::GcTodoEntry;
use crate::replication::*;
use crate::schema::*;
@@ -176,7 +177,7 @@ where
let pk_hash = Hash::try_from(&tree_key[..32]).unwrap();
let nodes = self.replication.write_nodes(&pk_hash);
if nodes.first() == Some(&self.system.id) {
- self.gc_todo.insert(&tree_key, new_bytes_hash.as_slice())?;
+ GcTodoEntry::new(tree_key, new_bytes_hash).save(&self.gc_todo)?;
}
}
}