]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os: generalize AlienStore beyond BlueStore.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 21 Jul 2021 09:42:06 +0000 (09:42 +0000)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 21 Jul 2021 13:11:16 +0000 (13:11 +0000)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/common/options/global.yaml.in
src/crimson/os/alienstore/alien_store.cc
src/crimson/os/alienstore/alien_store.h
src/crimson/os/futurized_store.cc
src/vstart.sh

index bb53ca64424bddd496abe44cf02038376422b188..04894a7548356acc50fb48be419852b02749720c 100644 (file)
@@ -3622,6 +3622,7 @@ options:
   - memstore
   - kstore
   - seastore
+  - cyanstore
   flags:
   - create
   with_legacy: true
index cb5cbf08c353cbc0cee66d54275ab6f3973607ba..d05c69ac096448056e2cf8d484421b39d3434e19 100644 (file)
@@ -17,8 +17,6 @@
 #include "common/ceph_context.h"
 #include "global/global_context.h"
 #include "include/Context.h"
-#include "os/bluestore/BlueStore.h"
-#include "os/memstore/MemStore.h"
 #include "os/ObjectStore.h"
 #include "os/Transaction.h"
 
@@ -65,10 +63,12 @@ namespace crimson::os {
 
 using crimson::common::get_conf;
 
-AlienStore::AlienStore(const std::string& path,
+AlienStore::AlienStore(const std::string& type,
+                       const std::string& path,
                        const ConfigValues& values,
                        seastar::alien::instance& alien)
-  : path{path},
+  : type(type),
+    path{path},
     alien{alien}
 {
   cct = std::make_unique<CephContext>(CEPH_ENTITY_TYPE_OSD);
@@ -78,7 +78,10 @@ AlienStore::AlienStore(const std::string& path,
 
 seastar::future<> AlienStore::start()
 {
-  store = std::make_unique<BlueStore>(cct.get(), path);
+  store = ObjectStore::create(cct.get(), type, path);
+  if (!store) {
+    ceph_abort_msgf("unsupported objectstore type: %s", type.c_str());
+  }
   std::vector<uint64_t> cpu_cores = _parse_cpu_cores();
   // cores except the first "N_CORES_FOR_SEASTAR" ones will
   // be used for alien threads scheduling:
index d9b9b3bcda6deec2227d87a1ffc3d5e459d75dba..aa0b53ace15b3a8224601f9f93c5a658158ed4a7 100644 (file)
@@ -43,7 +43,8 @@ public:
     AlienStore* store;
     CollectionRef ch;
   };
-  AlienStore(const std::string& path,
+  AlienStore(const std::string& type,
+             const std::string& path,
              const ConfigValues& values,
              seastar::alien::instance& alien);
   ~AlienStore() final;
@@ -128,6 +129,7 @@ private:
   static constexpr int N_CORES_FOR_SEASTAR = 3;
   constexpr static unsigned MAX_KEYS_PER_OMAP_GET_CALL = 32;
   mutable std::unique_ptr<crimson::os::ThreadPool> tp;
+  const std::string type;
   const std::string path;
   seastar::alien::instance& alien;
   uint64_t used_bytes = 0;
index e13052de57abefe03d9bfa990b6dc282a5669d34..90fb9de36d10102d14bf1b9529b893a924012911 100644 (file)
@@ -11,15 +11,14 @@ FuturizedStore::create(const std::string& type,
                        const ConfigValues& values,
                        seastar::alien::instance& alien)
 {
-  if (type == "memstore") {
+  if (type == "cyanstore") {
     return std::make_unique<crimson::os::CyanStore>(data);
-  } else if (type == "bluestore") {
-    return std::make_unique<crimson::os::AlienStore>(data, values, alien);
   } else if (type == "seastore") {
     return crimson::os::seastore::make_seastore(data, values);
   } else {
-    ceph_abort_msgf("unsupported objectstore type: %s", type.c_str());
-    return {};
+    // use AlienStore as a fallback. It adapts e.g. BlueStore.
+    return std::make_unique<crimson::os::AlienStore>(
+      type, data, values, alien);
   }
 }
 
index 1296d0492b1b4744c7b5cf2115ba73ee114ac3cf..5a7fd938ecc58e5b2a9124868f798acff327b14a 100755 (executable)
@@ -221,6 +221,7 @@ options:
        -b, --bluestore use bluestore as the osd objectstore backend (default)
        -f, --filestore use filestore as the osd objectstore backend
        -K, --kstore use kstore as the osd objectstore backend
+       --cyanstore use cyanstore as the osd objectstore backend
        --memstore use memstore as the osd objectstore backend
        --cache <pool>: enable cache tiering on pool
        --short: short object names only; necessary for ext4 dev