]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
src/test/crimson/seastore: add unit test case for listing entries of omap trees highe...
authorXuehan Xu <xxhdx1985126@gmail.com>
Wed, 29 Jun 2022 03:06:52 +0000 (11:06 +0800)
committerXuehan Xu <xxhdx1985126@gmail.com>
Thu, 30 Jun 2022 02:26:19 +0000 (10:26 +0800)
Signed-off-by: Xuehan Xu <xxhdx1985126@gmail.com>
src/crimson/os/seastore/cache.h
src/test/crimson/seastore/test_omap_manager.cc

index 081dd49743de977d9ff320289f0569652ca66ac8..53bf8bb234b4cf92e24279827c4d81c722ead29b 100644 (file)
@@ -1003,6 +1003,10 @@ public:
       return;
     }
   }
+
+  uint64_t get_omap_tree_depth() {
+    return stats.omap_tree_depth;
+  }
 private:
   ExtentPlacementManager& epm;
   RootBlockRef root;               ///< ref to current root
index 233d8ac5fd190fca2324550421a44778d5df0864..2b1e22818204d4896af4ee5f4b602f7a01965253 100644 (file)
@@ -408,6 +408,40 @@ TEST_F(omap_manager_test_t, force_split_listkeys_list_clear)
   });
 }
 
+TEST_F(omap_manager_test_t, force_inner_node_split_list)
+{
+  run_async([this] {
+    omap_root_t omap_root = initialize();
+
+    string temp = "";
+    while (cache->get_omap_tree_depth() < 3) {
+      for (unsigned i = 0; i < 40; i++) {
+       auto t = create_mutate_transaction();
+       logger().debug("opened transaction");
+       for (unsigned j = 0; j < 10; ++j) {
+         auto key = set_random_key(omap_root, *t);
+         if (key.compare(temp) < 0 || !temp.length())
+           temp = key;
+       }
+       logger().debug("force split submit transaction i = {}", i);
+       submit_transaction(std::move(t));
+      }
+    }
+
+    {
+      auto t = create_read_transaction();
+      list(omap_root, *t, temp, 10240);
+    }
+
+    {
+      auto t = create_mutate_transaction();
+      clear(omap_root, *t);
+      submit_transaction(std::move(t));
+    }
+  });
+}
+
+
 TEST_F(omap_manager_test_t, internal_force_split)
 {
   run_async([this] {