aboutsummaryrefslogtreecommitdiff
path: root/src/table/table.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-02-23 21:27:28 +0100
committerAlex Auvolat <alex@adnab.me>2021-02-23 21:27:28 +0100
commit20e6e9fa2035ac12946bf0dcd5b8049090955bde (patch)
tree96c9a1a72833b16672b69e588c625248f9b40857 /src/table/table.rs
parentbf25c95fe2fda4ded2e3ca14499e3991e7243532 (diff)
downloadgarage-20e6e9fa2035ac12946bf0dcd5b8049090955bde.tar.gz
garage-20e6e9fa2035ac12946bf0dcd5b8049090955bde.zip
Update sled & try to debug deadlock (but its in sled...)
Diffstat (limited to 'src/table/table.rs')
-rw-r--r--src/table/table.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/table/table.rs b/src/table/table.rs
index 737ed589..8389c29f 100644
--- a/src/table/table.rs
+++ b/src/table/table.rs
@@ -394,7 +394,7 @@ where
Some(prev_bytes) => {
let old_entry = self
.decode_entry(&prev_bytes)
- .map_err(sled::ConflictableTransactionError::Abort)?;
+ .map_err(sled::transaction::ConflictableTransactionError::Abort)?;
let mut new_entry = old_entry.clone();
new_entry.merge(&update);
(Some(old_entry), new_entry)
@@ -404,7 +404,7 @@ where
let new_bytes = rmp_to_vec_all_named(&new_entry)
.map_err(Error::RMPEncode)
- .map_err(sled::ConflictableTransactionError::Abort)?;
+ .map_err(sled::transaction::ConflictableTransactionError::Abort)?;
db.insert(tree_key.clone(), new_bytes)?;
Ok((old_entry, new_entry))
})?;
@@ -429,11 +429,7 @@ where
Ok(())
}
- pub(crate) fn delete_if_equal(
- self: &Arc<Self>,
- k: &[u8],
- v: &[u8],
- ) -> Result<bool, Error> {
+ pub(crate) fn delete_if_equal(self: &Arc<Self>, k: &[u8], v: &[u8]) -> Result<bool, Error> {
let removed = self.store.transaction(|txn| {
if let Some(cur_v) = self.store.get(k)? {
if cur_v == v {