Skip to content

Commit

Permalink
refine vnode check panic message
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed Nov 4, 2024
1 parent 2619ddf commit 2280741
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/common/src/hash/table_distribution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,14 @@ impl TableDistribution {
/// Check whether the given `vnode` is set in the `vnodes` of this table.
fn check_vnode_is_set(vnode: VirtualNode, vnodes: &Bitmap) {
let is_set = vnodes.is_set(vnode.to_index());
assert!(
is_set,
"vnode {} should not be accessed by this table",
vnode
);

if !is_set {
let high_ranges = vnodes.high_ranges().map(|r| format!("{r:?}")).join(", ");
panic!(
"vnode {} should not be accessed by this table\nvnode count: {}\nallowed vnodes: {}",
vnode,
vnodes.len(),
high_ranges
);
}
}

0 comments on commit 2280741

Please sign in to comment.