]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: make cache configurable durining init_storage
authorOrit Wasserman <owasserm@redhat.com>
Thu, 29 Mar 2018 07:54:33 +0000 (10:54 +0300)
committerOrit Wasserman <owasserm@redhat.com>
Sun, 8 Apr 2018 05:40:42 +0000 (08:40 +0300)
Fixes: http://tracker.ceph.com/issues/23468
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
src/rgw/rgw_admin.cc
src/rgw/rgw_main.cc
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h
src/rgw/rgw_realm_reloader.cc

index 06ce5a00322d53be98e723ed72a875afd6bffcf0..04903accef44a3db8d05db102f7461f02c06ec74 100644 (file)
@@ -2997,7 +2997,8 @@ int main(int argc, const char **argv)
   if (raw_storage_op) {
     store = RGWStoreManager::get_raw_storage(g_ceph_context);
   } else {
-    store = RGWStoreManager::get_storage(g_ceph_context, false, false, false, false, false);
+    store = RGWStoreManager::get_storage(g_ceph_context, false, false, false, false, false,
+      g_conf->rgw_cache_enabled);
   }
   if (!store) {
     cerr << "couldn't init storage provider" << std::endl;
index 76374aa6b2cf828b7d45a5008a8bf54c9fd73af6..bfafed70f0f694afc2f681438f11cc6791a88214 100644 (file)
@@ -293,7 +293,7 @@ int main(int argc, const char **argv)
 
   RGWRados *store = RGWStoreManager::get_storage(g_ceph_context,
       g_conf->rgw_enable_gc_threads, g_conf->rgw_enable_lc_threads, g_conf->rgw_enable_quota_threads,
-      g_conf->rgw_run_sync_thread, g_conf->rgw_dynamic_resharding);
+      g_conf->rgw_run_sync_thread, g_conf->rgw_dynamic_resharding, g_conf->rgw_cache_enabled);
   if (!store) {
     mutex.Lock();
     init_timer.cancel_all_events();
index d0e1298be0a68cdb7b5e1da009e285b9ec813da5..9d3042c869ba35097f719c78b5c0e331289b3d1a 100644 (file)
@@ -13900,14 +13900,14 @@ uint64_t RGWRados::next_bucket_id()
   return ++max_bucket_id;
 }
 
-RGWRados *RGWStoreManager::init_storage_provider(CephContext *cct, bool use_gc_thread, bool use_lc_thread, bool quota_threads, bool run_sync_thread, bool run_reshard_thread)
+RGWRados *RGWStoreManager::init_storage_provider(CephContext *cct, bool use_gc_thread, bool use_lc_thread,
+                                                bool quota_threads, bool run_sync_thread, bool run_reshard_thread, bool use_cache)
 {
-  int use_cache = cct->_conf->rgw_cache_enabled;
   RGWRados *store = NULL;
   if (!use_cache) {
     store = new RGWRados;
   } else {
-    store = new RGWCache<RGWRados>; 
+    store = new RGWCache<RGWRados>;
   }
 
   if (store->initialize(cct, use_gc_thread, use_lc_thread, quota_threads, run_sync_thread, run_reshard_thread) < 0) {
index dbc4f94ae43455b0468cdfc25ed584822e2c40e3..c5d1c6f3299a381b47400b78b6889bfdb55ede15 100644 (file)
@@ -3795,16 +3795,17 @@ public:
 class RGWStoreManager {
 public:
   RGWStoreManager() {}
-  static RGWRados *get_storage(CephContext *cct, bool use_gc_thread, bool use_lc_thread, bool quota_threads, bool run_sync_thread, bool run_reshard_thread) {
+  static RGWRados *get_storage(CephContext *cct, bool use_gc_thread, bool use_lc_thread, bool quota_threads,
+                              bool run_sync_thread, bool run_reshard_thread, bool use_cache = true) {
     RGWRados *store = init_storage_provider(cct, use_gc_thread, use_lc_thread, quota_threads, run_sync_thread,
-                                           run_reshard_thread);
+                                           run_reshard_thread, use_cache);
     return store;
   }
   static RGWRados *get_raw_storage(CephContext *cct) {
     RGWRados *store = init_raw_storage_provider(cct);
     return store;
   }
-  static RGWRados *init_storage_provider(CephContext *cct, bool use_gc_thread, bool use_lc_thread, bool quota_threads, bool run_sync_thread, bool run_reshard_thread);
+  static RGWRados *init_storage_provider(CephContext *cct, bool use_gc_thread, bool use_lc_thread, bool quota_threads, bool run_sync_thread, bool run_reshard_thread, bool use_metadata_cache);
   static RGWRados *init_raw_storage_provider(CephContext *cct);
   static void close_storage(RGWRados *store);
 
index 2bae84c1ecbd296fd56e1ac7ab8ee59f52d87d91..af4a72c5dc8b2079c57a58ceaff998f76f1a5b10 100644 (file)
@@ -105,7 +105,9 @@ void RGWRealmReloader::reload()
                                          cct->_conf->rgw_enable_lc_threads,
                                          cct->_conf->rgw_enable_quota_threads,
                                          cct->_conf->rgw_run_sync_thread,
-                                         cct->_conf->rgw_dynamic_resharding);
+                                         cct->_conf->rgw_dynamic_resharding,
+                                        cct->_conf->rgw_cache_enabled
+      );
 
     ldout(cct, 1) << "Creating new store" << dendl;