Skip to content

Commit eed061a

Browse files
authored
Merge pull request ceph#64466 from chanyoung/fix-list-complete
crimson/.../omap_btree_node_impl: fix complete flag for depth 2 omap scan Reviewed-by: Yingxin Cheng <[email protected]>
2 parents 0300dce + e623180 commit eed061a

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
@@ -788,6 +788,34 @@ TEST_P(omap_manager_test_t, omap_iterate)
788788
});
789789
}
790790

791+
TEST_P(omap_manager_test_t, full_range_list)
792+
{
793+
run_async([this] {
794+
omap_root_t omap_root = initialize();
795+
std::optional<std::string> first = std::nullopt;
796+
std::optional<std::string> last = std::nullopt;
797+
798+
auto full_range_list_and_log = [&](unsigned target_depth, std::string_view label) {
799+
do {
800+
auto t = create_mutate_transaction();
801+
for (unsigned i = 0; i < 100; ++i) {
802+
set_random_key(omap_root, *t);
803+
}
804+
submit_transaction(std::move(t));
805+
} while (omap_root.depth < target_depth);
806+
807+
auto t = create_read_transaction();
808+
logger().debug("[depth={}] {}", target_depth, label);
809+
list(omap_root, *t, first, last, test_omap_mappings.size());
810+
};
811+
812+
full_range_list_and_log(1, "full range list single leaf node");
813+
full_range_list_and_log(2, "full range list single inner node with multiple leaf nodes");
814+
// Skipped: covered by omap_manager_test_t.force_inner_node_split_list_rmkey_range.
815+
// full_range_list_and_log(3, "full range list multiple inner and leaf nodes");
816+
});
817+
}
818+
791819
INSTANTIATE_TEST_SUITE_P(
792820
omap_manager_test,
793821
omap_manager_test_t,

0 commit comments

Comments
 (0)