aboutsummaryrefslogtreecommitdiff
path: root/src/model/index_counter.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-06-08 17:50:00 +0200
committerAlex Auvolat <alex@adnab.me>2022-06-08 17:50:00 +0200
commit03e811bbbfca5a2467bb24ce1500c74661234947 (patch)
tree3729a62911507c8219c3b7756a0a60af9ca1665c /src/model/index_counter.rs
parentab374e71787b1da37e1f885e88090bbcbd53ec47 (diff)
downloadgarage-03e811bbbfca5a2467bb24ce1500c74661234947.tar.gz
garage-03e811bbbfca5a2467bb24ce1500c74661234947.zip
Call counter tables 'v2' because schema changed since last time
Diffstat (limited to 'src/model/index_counter.rs')
-rw-r--r--src/model/index_counter.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/model/index_counter.rs b/src/model/index_counter.rs
index 313d8612..36e8172b 100644
--- a/src/model/index_counter.rs
+++ b/src/model/index_counter.rs
@@ -158,7 +158,7 @@ impl<T: CountedItem> IndexCounter<T> {
let this = Arc::new(Self {
this_node: system.id,
local_counter: db
- .open_tree(format!("local_counter:{}", T::COUNTER_TABLE_NAME))
+ .open_tree(format!("local_counter_v2:{}", T::COUNTER_TABLE_NAME))
.expect("Unable to open local counter tree"),
propagate_tx,
table: Table::new(
@@ -346,6 +346,7 @@ impl<T: CountedItem> IndexCounter<T> {
break;
}
+ info!("zeroing old counters... ({})", hex::encode(&batch[0].0));
for (local_counter_k, local_counter) in batch {
let mut local_counter =
rmp_serde::decode::from_read_ref::<_, LocalCounterEntry<T>>(&local_counter)?;
@@ -390,6 +391,7 @@ impl<T: CountedItem> IndexCounter<T> {
break;
}
+ info!("counting entries... ({})", hex::encode(&batch[0].0));
for (counted_entry_k, counted_entry) in batch {
let counted_entry = counted_table.data.decode_entry(&counted_entry)?;