mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
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 <josh.durgin@inktank.com> Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
This commit is contained in:
parent
e7f7483192
commit
4216eac0f5
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user