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 <chaney.p@kakaoenterprise.com>
size_t l_size = left.get_size();
size_t r_size = right.get_size();
- ceph_assert(pivot_idx != l_size && pivot_idx != r_size);
+ ceph_assert(pivot_idx != l_size);
replacement_left.maybe_expand_children(pivot_idx);
replacement_right.maybe_expand_children(r_size + l_size - pivot_idx);