]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/osd: create secondary devices when mkfs
authorZhang Song <zhangsong02@qianxin.com>
Tue, 26 Mar 2024 03:52:15 +0000 (11:52 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Tue, 7 Jul 2026 08:15:30 +0000 (16:15 +0800)
Signed-off-by: Zhang Song <zhangsong02@qianxin.com>
Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/common/options/crimson.yaml.in
src/crimson/osd/main.cc

index 3ef4dc683eaa798bd8422b8f5f8ecd36ad992f40..efa0fe550c3d6a8011f536d2d5af7ae5fbc2dcc7 100644 (file)
@@ -249,6 +249,11 @@ options:
   level: advanced
   desc: Size in bytes per second written to the main devices, 0 incidates no limit
   default: 0
+- name: seastore_secondary_devices_count
+  type: size
+  level: dev
+  desc: create secondary devices during mkfs
+  default: 0
 - name: seastore_secondary_device_type
   type: str
   level: dev
index 86bbbe1ab98d5ccb56aafc25734e8ba622e9087b..f44a454138e30128803189e3af9c7b7a3b3095bf 100644 (file)
@@ -264,6 +264,15 @@ int main(int argc, const char* argv[])
               // use a random osd uuid if not specified
               osd_uuid.generate_random();
             }
+            if (auto c = local_conf().get_val<Option::size_t>("seastore_secondary_devices_count");
+                c != 0) {
+              auto root = local_conf().get_val<std::string>("osd_data");
+              for (size_t i = 1; i <= c; i++) {
+                auto path = fmt::format("{}/block.{}", root, i);
+                seastar::touch_directory(path).get();
+              }
+              seastar::sync_directory(root).get();
+            }
             osd.mkfs(
              *store,
              whoami,