Call counter tables 'v2' because schema changed since last time
This commit is contained in:
parent
ab374e7178
commit
03e811bbbf
2 changed files with 4 additions and 2 deletions
|
@ -158,7 +158,7 @@ impl<T: CountedItem> IndexCounter<T> {
|
||||||
let this = Arc::new(Self {
|
let this = Arc::new(Self {
|
||||||
this_node: system.id,
|
this_node: system.id,
|
||||||
local_counter: db
|
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"),
|
.expect("Unable to open local counter tree"),
|
||||||
propagate_tx,
|
propagate_tx,
|
||||||
table: Table::new(
|
table: Table::new(
|
||||||
|
@ -346,6 +346,7 @@ impl<T: CountedItem> IndexCounter<T> {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
info!("zeroing old counters... ({})", hex::encode(&batch[0].0));
|
||||||
for (local_counter_k, local_counter) in batch {
|
for (local_counter_k, local_counter) in batch {
|
||||||
let mut local_counter =
|
let mut local_counter =
|
||||||
rmp_serde::decode::from_read_ref::<_, LocalCounterEntry<T>>(&local_counter)?;
|
rmp_serde::decode::from_read_ref::<_, LocalCounterEntry<T>>(&local_counter)?;
|
||||||
|
@ -390,6 +391,7 @@ impl<T: CountedItem> IndexCounter<T> {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
info!("counting entries... ({})", hex::encode(&batch[0].0));
|
||||||
for (counted_entry_k, counted_entry) in batch {
|
for (counted_entry_k, counted_entry) in batch {
|
||||||
let counted_entry = counted_table.data.decode_entry(&counted_entry)?;
|
let counted_entry = counted_table.data.decode_entry(&counted_entry)?;
|
||||||
|
|
||||||
|
|
|
@ -240,7 +240,7 @@ impl TableSchema for K2VItemTable {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CountedItem for K2VItem {
|
impl CountedItem for K2VItem {
|
||||||
const COUNTER_TABLE_NAME: &'static str = "k2v_index_counter";
|
const COUNTER_TABLE_NAME: &'static str = "k2v_index_counter_v2";
|
||||||
|
|
||||||
// Partition key = bucket id
|
// Partition key = bucket id
|
||||||
type CP = Uuid;
|
type CP = Uuid;
|
||||||
|
|
Loading…
Reference in a new issue