Skip to content

Commit e623180

Browse files
committed
crimson/.../omap_btree_node_impl: fix complete flag for depth 2 omap list
Fixes: https://tracker.ceph.com/issues/72100 Signed-off-by: Chanyoung Park <[email protected]>
1 parent 0dc9bd0 commit e623180

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

src/crimson/os/seastore/omap_manager/btree/omap_btree_node_impl.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ OMapInnerNode::list(
353353
}
354354
result.merge(std::move(child_result));
355355
if (result.size() == config.max_result_size) {
356+
complete = child_complete;
356357
return list_iertr::make_ready_future<seastar::stop_iteration>(
357358
seastar::stop_iteration::yes);
358359
}

src/test/crimson/seastore/test_omap_manager.cc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,34 @@ TEST_P(omap_manager_test_t, omap_iterate)
833833
});
834834
}
835835

836+
TEST_P(omap_manager_test_t, full_range_list)
837+
{
838+
run_async([this] {
839+
omap_root_t omap_root = initialize();
840+
std::optional<std::string> first = std::nullopt;
841+
std::optional<std::string> last = std::nullopt;
842+
843+
auto full_range_list_and_log = [&](unsigned target_depth, std::string_view label) {
844+
do {
845+
auto t = create_mutate_transaction();
846+
for (unsigned i = 0; i < 100; ++i) {
847+
set_random_key(omap_root, *t);
848+
}
849+
submit_transaction(std::move(t));
850+
} while (omap_root.depth < target_depth);
851+
852+
auto t = create_read_transaction();
853+
logger().debug("[depth={}] {}", target_depth, label);
854+
list(omap_root, *t, first, last, test_omap_mappings.size());
855+
};
856+
857+
full_range_list_and_log(1, "full range list single leaf node");
858+
full_range_list_and_log(2, "full range list single inner node with multiple leaf nodes");
859+
// Skipped: covered by omap_manager_test_t.force_inner_node_split_list_rmkey_range.
860+
// full_range_list_and_log(3, "full range list multiple inner and leaf nodes");
861+
});
862+
}
863+
836864
INSTANTIATE_TEST_SUITE_P(
837865
omap_manager_test,
838866
omap_manager_test_t,

0 commit comments

Comments
 (0)