From: Chanyoung Park Date: Fri, 18 Jul 2025 08:06:15 +0000 (+0000) Subject: test/crimson/seastore/test_omap_manager: add heavy update UT X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2d279d82622953e5e1ed2833221812ff18997bfd;p=ceph.git test/crimson/seastore/test_omap_manager: add heavy update UT Signed-off-by: Chanyoung Park --- diff --git a/src/test/crimson/seastore/test_omap_manager.cc b/src/test/crimson/seastore/test_omap_manager.cc index 6f836f8d0f3c..1bda7442a7ad 100644 --- a/src/test/crimson/seastore/test_omap_manager.cc +++ b/src/test/crimson/seastore/test_omap_manager.cc @@ -859,6 +859,40 @@ TEST_P(omap_manager_test_t, increasing_key_size) }); } +TEST_P(omap_manager_test_t, heavy_update) +{ + run_async([this] { + omap_root_t omap_root = initialize(); + + std::vector inserted_keys; + while (omap_root.get_depth() < 2) { + auto t = create_mutate_transaction(); + for (unsigned i = 0; i < 64; ++i) { + auto key = set_random_key(omap_root, *t); + inserted_keys.push_back(key); + } + submit_transaction(std::move(t)); + } + check_mappings(omap_root); + + for (unsigned round = 0; round < 10; ++round) { + // For each round, select 1024 random keys (including possible + // duplicates) and update their values with data of size + // pow(2, round) bytes. This covers a wide range of update + // scenarios with varying value sizes. + auto t = create_mutate_transaction(); + for (unsigned batch = 0; batch < 1024; ++batch) { + auto key = inserted_keys[rand() % inserted_keys.size()]; + auto val = rand_buffer(std::pow(2, round)); + set_key(omap_root, *t, key, val); + } + check_mappings(omap_root, *t); + submit_transaction(std::move(t)); + check_mappings(omap_root); + } + }); +} + INSTANTIATE_TEST_SUITE_P( omap_manager_test, omap_manager_test_t,