From: Yehuda Sadeh Date: Fri, 13 Sep 2013 21:43:54 +0000 (-0700) Subject: rgw: try to create log pool if doesn't exist X-Git-Tag: v0.67.5~20^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7f57d9dda74a1feb2da85be3c77d61c6f81ec1b2;p=ceph.git rgw: try to create log pool if doesn't exist 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 Signed-off-by: Yehuda Sadeh (cherry picked from commit 4216eac0f59af60f60d4ce909b9ace87a7b64ccc) --- diff --git a/src/rgw/rgw_replica_log.cc b/src/rgw/rgw_replica_log.cc index 483d256377b..f80ebf88525 100644 --- a/src/rgw/rgw_replica_log.cc +++ b/src/rgw/rgw_replica_log.cc @@ -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; }