]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/.../linked_tree_node: fix pivot_idx assertion in balancing
authorChanyoung Park <chaney.p@kakaoenterprise.com>
Mon, 28 Jul 2025 08:44:34 +0000 (08:44 +0000)
committerChanyoung Park <chaney.p@kakaoenterprise.com>
Tue, 29 Jul 2025 16:09:30 +0000 (16:09 +0000)
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>
src/crimson/os/seastore/linked_tree_node.h

index 2dd152b07e766b356b34e6429ad2e29710c5ed6c..8bf4097bbb0c9f23e26bc8063620bbc2957fd9e2 100644 (file)
@@ -655,7 +655,7 @@ protected:
     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);