diff options
author | Yehuda Sadeh <yehuda@inktank.com> | 2013-09-13 14:43:54 -0700 |
---|---|---|
committer | Yehuda Sadeh <yehuda@inktank.com> | 2013-09-13 14:43:54 -0700 |
commit | 84d41248bcdc585a6bd13520b9aa2d75ee987017 (patch) | |
tree | fee4b06d6961857d7a72215cd7c2fa71c3d319e0 | |
parent | 40e0cabcb45ef0457557a630fea404effc406082 (diff) | |
download | ceph-84d41248bcdc585a6bd13520b9aa2d75ee987017.tar.gz |
rgw: try to create log pool if doesn't existwip-6302
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.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r-- | src/rgw/rgw_replica_log.cc | 9 |
1 files changed, 9 insertions, 0 deletions
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; } |