Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug logging for recently seen panic during testing #168

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/storage/trie/trie_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down