From: Radoslaw Zarzynski Date: Wed, 21 Jul 2021 09:42:06 +0000 (+0000) Subject: crimson/os: generalize AlienStore beyond BlueStore. X-Git-Tag: v17.1.0~1314^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e6ed65db8b4e0a2f8026c2e35a12dd292c5f2b8c;p=ceph-ci.git crimson/os: generalize AlienStore beyond BlueStore. Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/common/options/global.yaml.in b/src/common/options/global.yaml.in index bb53ca64424..04894a75483 100644 --- a/src/common/options/global.yaml.in +++ b/src/common/options/global.yaml.in @@ -3622,6 +3622,7 @@ options: - memstore - kstore - seastore + - cyanstore flags: - create with_legacy: true diff --git a/src/crimson/os/alienstore/alien_store.cc b/src/crimson/os/alienstore/alien_store.cc index cb5cbf08c35..d05c69ac096 100644 --- a/src/crimson/os/alienstore/alien_store.cc +++ b/src/crimson/os/alienstore/alien_store.cc @@ -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(CEPH_ENTITY_TYPE_OSD); @@ -78,7 +78,10 @@ AlienStore::AlienStore(const std::string& path, seastar::future<> AlienStore::start() { - store = std::make_unique(cct.get(), path); + store = ObjectStore::create(cct.get(), type, path); + if (!store) { + ceph_abort_msgf("unsupported objectstore type: %s", type.c_str()); + } std::vector cpu_cores = _parse_cpu_cores(); // cores except the first "N_CORES_FOR_SEASTAR" ones will // be used for alien threads scheduling: diff --git a/src/crimson/os/alienstore/alien_store.h b/src/crimson/os/alienstore/alien_store.h index d9b9b3bcda6..aa0b53ace15 100644 --- a/src/crimson/os/alienstore/alien_store.h +++ b/src/crimson/os/alienstore/alien_store.h @@ -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 tp; + const std::string type; const std::string path; seastar::alien::instance& alien; uint64_t used_bytes = 0; diff --git a/src/crimson/os/futurized_store.cc b/src/crimson/os/futurized_store.cc index e13052de57a..90fb9de36d1 100644 --- a/src/crimson/os/futurized_store.cc +++ b/src/crimson/os/futurized_store.cc @@ -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(data); - } else if (type == "bluestore") { - return std::make_unique(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( + type, data, values, alien); } } diff --git a/src/vstart.sh b/src/vstart.sh index 1296d0492b1..5a7fd938ecc 100755 --- a/src/vstart.sh +++ b/src/vstart.sh @@ -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 : enable cache tiering on pool --short: short object names only; necessary for ext4 dev