Skip to content

Commit

Permalink
feat: enable verbose instrument for iter rewind and block I/O (#12672)
Browse files Browse the repository at this point in the history
  • Loading branch information
hzxa21 authored Oct 8, 2023
1 parent e69f513 commit 129ab28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/storage/src/hummock/block_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use std::hash::{Hash, Hasher};
use std::ops::Deref;
use std::sync::Arc;

use await_tree::InstrumentAwait;
use futures::Future;
use risingwave_common::cache::{
CachePriority, CacheableEntry, LookupResponse, LruCache, LruCacheEventListener,
Expand Down Expand Up @@ -99,10 +100,12 @@ impl BlockResponse {
match self {
BlockResponse::Block(block_holder) => Ok(block_holder),
BlockResponse::WaitPendingRequest(receiver) => receiver
.verbose_instrument_await("wait_pending_fetch_block")
.await
.map_err(|recv_error| recv_error.into())
.map(BlockHolder::from_cached_block),
BlockResponse::Miss(join_handle) => join_handle
.verbose_instrument_await("fetch_block")
.await
.unwrap()
.map(BlockHolder::from_cached_block),
Expand Down
3 changes: 2 additions & 1 deletion src/storage/src/hummock/store/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use std::collections::HashSet;
use std::iter::once;
use std::sync::Arc;

use await_tree::InstrumentAwait;
use bytes::Bytes;
use itertools::Itertools;
use parking_lot::RwLock;
Expand Down Expand Up @@ -924,7 +925,7 @@ impl HummockVersionReader {
);
user_iter
.rewind()
.instrument(tracing::trace_span!("rewind"))
.verbose_instrument_await("rewind")
.await?;
local_stats.found_key = user_iter.is_valid();
local_stats.sub_iter_count = local_stats.staging_imm_iter_count
Expand Down

0 comments on commit 129ab28

Please sign in to comment.