diff options
author | Alex Auvolat <alex@adnab.me> | 2021-03-12 14:37:46 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2021-03-12 14:37:46 +0100 |
commit | 7fdaf7aef0c2aa8b38dbc7dac630f6f9baf8f0a4 (patch) | |
tree | c7b212ed0333dfc57bb39370d85060d1d1a103eb /src/table/merkle.rs | |
parent | 1ec49980ec876ef9395a9ae088f82d86a1a0d9f6 (diff) | |
download | garage-7fdaf7aef0c2aa8b38dbc7dac630f6f9baf8f0a4.tar.gz garage-7fdaf7aef0c2aa8b38dbc7dac630f6f9baf8f0a4.zip |
Fix merkle updater not being notified; improved logging
Diffstat (limited to 'src/table/merkle.rs')
-rw-r--r-- | src/table/merkle.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/table/merkle.rs b/src/table/merkle.rs index 467ce615..a694c9e9 100644 --- a/src/table/merkle.rs +++ b/src/table/merkle.rs @@ -4,7 +4,7 @@ use std::time::Duration; use futures::select; use futures_util::future::*; -use log::{info, warn}; +use log::{debug, warn}; use serde::{Deserialize, Serialize}; use sled::transaction::{ ConflictableTransactionError, ConflictableTransactionResult, TransactionalTree, @@ -109,11 +109,11 @@ impl MerkleUpdater { match x { Ok((key, valhash)) => { if let Err(e) = self.update_item(&key[..], &valhash[..]) { - warn!("Error while updating Merkle tree item: {}", e); + warn!("({}) Error while updating Merkle tree item: {}", self.table_name, e); } } Err(e) => { - warn!("Error while iterating on Merkle todo tree: {}", e); + warn!("({}) Error while iterating on Merkle todo tree: {}", self.table_name, e); tokio::time::delay_for(Duration::from_secs(10)).await; } } @@ -152,8 +152,9 @@ impl MerkleUpdater { .is_ok(); if !deleted { - info!( - "Item not deleted from Merkle todo because it changed: {:?}", + debug!( + "({}) Item not deleted from Merkle todo because it changed: {:?}", + self.table_name, k ); } @@ -195,7 +196,7 @@ impl MerkleUpdater { if children.len() == 0 { // should not happen - warn!("Replacing intermediate node with empty node, should not happen."); + warn!("({}) Replacing intermediate node with empty node, should not happen.", self.table_name); Some(MerkleNode::Empty) } else if children.len() == 1 { // We now have a single node (case when the update deleted one of only two |