aboutsummaryrefslogtreecommitdiff
path: root/src/table
diff options
context:
space:
mode:
Diffstat (limited to 'src/table')
-rw-r--r--src/table/Cargo.toml2
-rw-r--r--src/table/table.rs10
-rw-r--r--src/table/table_sync.rs6
3 files changed, 10 insertions, 8 deletions
diff --git a/src/table/Cargo.toml b/src/table/Cargo.toml
index 483c386c..6485a542 100644
--- a/src/table/Cargo.toml
+++ b/src/table/Cargo.toml
@@ -23,7 +23,7 @@ arc-swap = "0.4"
log = "0.4"
hexdump = "0.1"
-sled = "0.31"
+sled = "0.34"
rmp-serde = "0.14.3"
serde = { version = "1.0", default-features = false, features = ["derive", "rc"] }
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 {
diff --git a/src/table/table_sync.rs b/src/table/table_sync.rs
index b81dad86..58391274 100644
--- a/src/table/table_sync.rs
+++ b/src/table/table_sync.rs
@@ -385,6 +385,7 @@ where
must_exit: &mut watch::Receiver<bool>,
) -> Result<RangeChecksum, Error> {
assert!(range.level != 0);
+ trace!("Call range_checksum {:?}", range);
if range.level == 1 {
let mut children = vec![];
@@ -400,6 +401,7 @@ where
.iter()
.all(|x| *x == 0u8)
{
+ trace!("range_checksum {:?} returning {} items", range, children.len());
return Ok(RangeChecksum {
bounds: range.clone(),
children,
@@ -414,6 +416,7 @@ where
};
children.push((item_range, blake2sum(&value[..])));
}
+ trace!("range_checksum {:?} returning {} items", range, children.len());
Ok(RangeChecksum {
bounds: range.clone(),
children,
@@ -439,6 +442,7 @@ where
}
if sub_ck.found_limit.is_none() || sub_ck.hash.is_none() {
+ trace!("range_checksum {:?} returning {} items", range, children.len());
return Ok(RangeChecksum {
bounds: range.clone(),
children,
@@ -453,6 +457,7 @@ where
.iter()
.all(|x| *x == 0u8)
{
+ trace!("range_checksum {:?} returning {} items", range, children.len());
return Ok(RangeChecksum {
bounds: range.clone(),
children,
@@ -463,6 +468,7 @@ where
sub_range.begin = found_limit;
}
+ trace!("range_checksum {:?} exiting due to must_exit", range);
Err(Error::Message(format!("Exiting.")))
}
}