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

[CHORE] Add tracing to blockfile gets #2485

Merged
merged 1 commit into from
Jul 10, 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
11 changes: 9 additions & 2 deletions rust/worker/src/blockstore/arrow/blockfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use parking_lot::Mutex;
use std::{collections::HashMap, sync::Arc};
use std::{collections::HashSet, mem::transmute};
use thiserror::Error;
use tracing::{trace_span, Instrument};
use uuid::Uuid;

#[derive(Clone)]
Expand Down Expand Up @@ -280,9 +281,15 @@ impl<'me, K: ArrowReadableKey<'me> + Into<KeyWrapper>, V: ArrowReadableValue<'me
pub(crate) async fn get(&'me self, prefix: &str, key: K) -> Result<V, Box<dyn ChromaError>> {
let search_key = CompositeKey::new(prefix.to_string(), key.clone());
let target_block_id = self.sparse_index.get_target_block_id(&search_key);
let block = self.get_block(target_block_id).await;
let block = self
.get_block(target_block_id)
.instrument(tracing::info_span!("Get Block", block_id = %target_block_id))
.await;
let res = match block {
Some(block) => block.get(prefix, key.clone()),
Some(block) => {
let block_get_span = tracing::info_span!("Block Get", block_id = %target_block_id);
block_get_span.in_scope(|| block.get(prefix, key.clone()))
}
None => {
tracing::error!("Block with id {:?} not found", target_block_id);
return Err(Box::new(ArrowBlockfileError::BlockNotFound));
Expand Down
Loading