int RGWRados::get_required_alignment(const DoutPrefixProvider *dpp, const rgw_pool& pool, uint64_t *alignment)
{
IoCtx ioctx;
- int r = open_pool_ctx(dpp, pool, ioctx, false);
+ int r = open_pool_ctx(dpp, pool, ioctx, false, true);
if (r < 0) {
ldpp_dout(dpp, 0) << "ERROR: open_pool_ctx() returned " << r << dendl;
return r;
}
int RGWRados::open_pool_ctx(const DoutPrefixProvider *dpp, const rgw_pool& pool, librados::IoCtx& io_ctx,
- bool mostly_omap)
+ bool mostly_omap, bool bulk)
{
constexpr bool create = true; // create the pool if it doesn't exist
- return rgw_init_ioctx(dpp, get_rados_handle(), pool, io_ctx, create, mostly_omap);
+ return rgw_init_ioctx(dpp, get_rados_handle(), pool, io_ctx, create, mostly_omap, bulk);
}
/**** logs ****/
return -EIO;
}
- int r = open_pool_ctx(dpp, pool, *ioctx, false);
+ int r = open_pool_ctx(dpp, pool, *ioctx, false, true);
if (r < 0) {
ldpp_dout(dpp, 0) << "ERROR: unable to open data-pool=" << pool.to_str() <<
" for obj=" << obj << " with error-code=" << r << dendl;
auto iter = state.io_ctxs.find(read_obj.pool);
if (iter == state.io_ctxs.end()) {
state.cur_ioctx = &state.io_ctxs[read_obj.pool];
- r = store->open_pool_ctx(dpp, read_obj.pool, *state.cur_ioctx, false);
+ r = store->open_pool_ctx(dpp, read_obj.pool, *state.cur_ioctx, false, true);
if (r < 0) {
ldpp_dout(dpp, 20) << "ERROR: failed to open pool context for pool=" << read_obj.pool << " r=" << r << dendl;
return r;
librados::IoCtx& io_ctx = ctx.io_ctx;
librados::NObjectIterator& iter = ctx.iter;
- int r = open_pool_ctx(dpp, pool, io_ctx, false);
+ int r = open_pool_ctx(dpp, pool, io_ctx, false, false);
if (r < 0)
return r;
librados::IoCtx& io_ctx = ctx.io_ctx;
librados::NObjectIterator& iter = ctx.iter;
- int r = open_pool_ctx(dpp, pool, io_ctx, false);
+ int r = open_pool_ctx(dpp, pool, io_ctx, false, false);
if (r < 0)
return r;
int rgw_init_ioctx(const DoutPrefixProvider *dpp,
librados::Rados *rados, const rgw_pool& pool,
librados::IoCtx& ioctx, bool create,
- bool mostly_omap)
+ bool mostly_omap,
+ bool bulk)
{
int r = rados->ioctx_create(pool.name.c_str(), ioctx);
if (r == -ENOENT && create) {
<< pool.name << dendl;
}
}
+ if (bulk) {
+ // set bulk
+ bufferlist inbl;
+ int r = rados->mon_command(
+ "{\"prefix\": \"osd pool set\", \"pool\": \"" +
+ pool.name + "\", \"var\": \"bulk\", \"val\": \"true\"}",
+ inbl, NULL, NULL);
+ if (r < 0) {
+ ldpp_dout(dpp, 10) << __func__ << " warning: failed to set 'bulk' on "
+ << pool.name << dendl;
+ }
+ }
} else if (r < 0) {
return r;
}