Skip to content

Commit e8f8879

Browse files
committed
crimson/.../linked_tree_node: fix pivot_idx assertion in balancing
The pivot_idx is defined in the global index space of the combined left and right nodes, and since each key may have a different byte size, a pivot index that happens to be equal to r_size can still result in a valid rebalancing. Therefore, we only exclude the case where pivot_idx == l_size, which means no actual rebalancing would occur. Fixes: https://tracker.ceph.com/issues/72303 Signed-off-by: Chanyoung Park <[email protected]>
1 parent 5b828b6 commit e8f8879

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/crimson/os/seastore/linked_tree_node.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ class ParentNode {
655655
size_t l_size = left.get_size();
656656
size_t r_size = right.get_size();
657657

658-
ceph_assert(pivot_idx != l_size && pivot_idx != r_size);
658+
ceph_assert(pivot_idx != l_size);
659659
replacement_left.maybe_expand_children(pivot_idx);
660660
replacement_right.maybe_expand_children(r_size + l_size - pivot_idx);
661661

0 commit comments

Comments
 (0)