]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: report error and fail if store returns no meta collection
authorIgor Fedotov <ifedotov@suse.com>
Mon, 8 Nov 2021 12:14:46 +0000 (15:14 +0300)
committerIgor Fedotov <igor.fedotov@croit.io>
Thu, 2 Dec 2021 22:33:24 +0000 (01:33 +0300)
Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
src/osd/OSD.cc

index 5b73d77d00639c997092ab37774024e7039dcf5b..15a90aede62d9a8702bd4cf264a89eed9e6336c5 100644 (file)
@@ -3479,6 +3479,10 @@ int OSD::init()
 
   store->set_cache_shards(get_num_cache_shards());
 
+ int rotating_auth_attempts = 0;
+ auto rotating_auth_timeout =
+   g_conf().get_val<int64_t>("rotating_keys_bootstrap_timeout");
+
   int r = store->mount();
   if (r < 0) {
     derr << "OSD:init: unable to mount object store" << dendl;
@@ -3493,7 +3497,12 @@ int OSD::init()
   dout(2) << "boot" << dendl;
 
   service.meta_ch = store->open_collection(coll_t::meta());
-
+  if (!service.meta_ch) {
+    derr << "OSD:init: unable to open meta collection"
+         << dendl;
+    r = -ENOENT;
+    goto out;
+  }
   // initialize the daily loadavg with current 15min loadavg
   double loadavgs[3];
   if (getloadavg(loadavgs, 3) == 3) {
@@ -3503,10 +3512,6 @@ int OSD::init()
     daily_loadavg = 1.0;
   }
 
-  int rotating_auth_attempts = 0;
-  auto rotating_auth_timeout =
-    g_conf().get_val<int64_t>("rotating_keys_bootstrap_timeout");
-
   // sanity check long object name handling
   {
     hobject_t l;