]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: try to create log pool if doesn't exist
authorYehuda Sadeh <yehuda@inktank.com>
Fri, 13 Sep 2013 21:43:54 +0000 (14:43 -0700)
committerYehuda Sadeh <yehuda@inktank.com>
Fri, 13 Sep 2013 22:35:26 +0000 (15:35 -0700)
When using replica log, if the log pool doesn't exist all operations are
going to fail. Try to create it if doesn't exist.

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/rgw/rgw_replica_log.cc

index 483d256377bcf9125d417520e7604e4366cc31d2..f80ebf88525bfbe7c9cb5d3caaaba184acf908b1 100644 (file)
@@ -34,6 +34,15 @@ RGWReplicaLogger::RGWReplicaLogger(RGWRados *_store) :
 int RGWReplicaLogger::open_ioctx(librados::IoCtx& ctx, const string& pool)
 {
   int r = store->rados->ioctx_create(pool.c_str(), ctx);
+  if (r == -ENOENT) {
+    rgw_bucket p(pool.c_str());
+    r = store->create_pool(p);
+    if (r < 0)
+      return r;
+
+    // retry
+    r = store->rados->ioctx_create(pool.c_str(), ctx);
+  }
   if (r < 0) {
     lderr(cct) << "ERROR: could not open rados pool " << pool << dendl;
   }