From ebc9723cf3a3782ba5ea398c587e4943077539dd Mon Sep 17 00:00:00 2001 From: Soumya Koduri Date: Sun, 5 Sep 2021 12:51:18 +0530 Subject: [PATCH] rgw: Add option to configure backend store Signed-off-by: Soumya Koduri --- src/common/options/rgw.yaml.in | 11 +++++++++++ src/rgw/rgw_main.cc | 11 ++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/common/options/rgw.yaml.in b/src/common/options/rgw.yaml.in index 961d22b9e6d71..0cbf397783eeb 100644 --- a/src/common/options/rgw.yaml.in +++ b/src/common/options/rgw.yaml.in @@ -3220,6 +3220,17 @@ options: see_also: - rgw_thread_pool_size with_legacy: true +- name: rgw_backend_store + type: str + level: advanced + desc: experimental Option to set backend store type + long_desc: defaults to rados. Other valid values are dbstore(experimental). + default: rados + services: + - rgw + enum_values: + - rados + - dbstore - name: rgw_luarocks_location type: str level: advanced diff --git a/src/rgw/rgw_main.cc b/src/rgw/rgw_main.cc index c44b0cba61cab..b905aa5c64df4 100644 --- a/src/rgw/rgw_main.cc +++ b/src/rgw/rgw_main.cc @@ -346,9 +346,18 @@ int radosgw_Main(int argc, const char **argv) } lsubdout(cct, rgw, 1) << "D3N datacache enabled: " << rgw_d3n_datacache_enabled << dendl; + std::string rgw_store = (!rgw_d3n_datacache_enabled) ? "rados" : "d3n"; + + const auto& config_store = g_conf().get_val("rgw_backend_store"); +#ifdef WITH_RADOSGW_DBSTORE + if (config_store == "dbstore") { + rgw_store = "dbstore"; + } +#endif + rgw::sal::Store* store = StoreManager::get_storage(&dp, g_ceph_context, - (!rgw_d3n_datacache_enabled) ? "rados" : "d3n", + rgw_store, g_conf()->rgw_enable_gc_threads, g_conf()->rgw_enable_lc_threads, g_conf()->rgw_enable_quota_threads, -- 2.39.5