diff --git a/src/storage/trie/trie_node.rs b/src/storage/trie/trie_node.rs index 826edc5..27dcd9b 100644 --- a/src/storage/trie/trie_node.rs +++ b/src/storage/trie/trie_node.rs @@ -9,6 +9,7 @@ use crate::proto::DbTrieNode; use prost::Message as _; use std::collections::HashMap; use std::sync::atomic; +use tracing::error; // TODO: remove or reduce this and/or rename (make sure it works under all branching factors) pub const TIMESTAMP_LENGTH: usize = 10; @@ -461,6 +462,14 @@ impl TrieNode { let key = self.key.take().unwrap(); let prefix = key[..current_index].to_vec(); + // we saw some crashes here during testing, let's log here even though a panic is incoming + if current_index >= key.len() { + error!( + key = hex::encode(&key), + current_index, "current_index out of bounds" + ); + } + let new_child_char = key[current_index]; self.children