ldpp_dout(this, 15) << "supplied_md5=" << supplied_md5 << dendl;
}
+
rgw_obj obj(s->bucket, get_current_filename());
if (s->bucket_info.versioning_enabled()) {
store->gen_rand_obj_instance_name(&obj);
rgw::AioThrottle aio(s->cct->_conf->rgw_put_obj_min_window_size);
using namespace rgw::putobj;
AtomicObjectProcessor processor(&aio, store, s->bucket_info,
+ nullptr,
s->bucket_owner.get_id(),
*static_cast<RGWObjectCtx*>(s->obj_ctx),
obj, 0, s->req_id);
src_obj,
dest_bucket_info,
src_bucket_info,
+ nullptr, /* dest placement rule */
&src_mtime,
&mtime,
mod_ptr,
rgw::AioThrottle aio(store->ctx()->_conf->rgw_put_obj_min_window_size);
using namespace rgw::putobj;
- AtomicObjectProcessor processor(&aio, store, binfo, bowner.get_id(),
+ AtomicObjectProcessor processor(&aio, store, binfo, nullptr, bowner.get_id(),
obj_ctx, obj, 0, s->req_id);
op_ret = processor.prepare();
r = manifest_gen.create_begin(store->ctx(), &manifest,
bucket_info.placement_rule,
+ ptail_placement_rule,
head_obj.bucket, head_obj);
if (r < 0) {
return r;
{
int r = manifest_gen.create_begin(store->ctx(), &manifest,
bucket_info.placement_rule,
+ ptail_placement_rule,
target_obj.bucket, target_obj);
if (r < 0) {
return r;
protected:
RGWRados *const store;
const RGWBucketInfo& bucket_info;
+ const string *ptail_placement_rule;
const rgw_user& owner;
RGWObjectCtx& obj_ctx;
rgw_obj head_obj;
public:
ManifestObjectProcessor(Aio *aio, RGWRados *store,
const RGWBucketInfo& bucket_info,
+ const string *ptail_placement_rule,
const rgw_user& owner, RGWObjectCtx& obj_ctx,
const rgw_obj& head_obj)
: HeadObjectProcessor(0),
- store(store), bucket_info(bucket_info), owner(owner),
+ store(store), bucket_info(bucket_info),
+ ptail_placement_rule(ptail_placement_rule), owner(owner),
obj_ctx(obj_ctx), head_obj(head_obj),
writer(aio, store, bucket_info, obj_ctx, head_obj),
chunk(&writer, 0), stripe(&chunk, this, 0)
int process_first_chunk(bufferlist&& data, DataProcessor **processor) override;
public:
AtomicObjectProcessor(Aio *aio, RGWRados *store,
- const RGWBucketInfo& bucket_info, const rgw_user& owner,
+ const RGWBucketInfo& bucket_info,
+ const string *ptail_placement_rule,
+ const rgw_user& owner,
RGWObjectCtx& obj_ctx, const rgw_obj& head_obj,
std::optional<uint64_t> olh_epoch,
const std::string& unique_tag)
- : ManifestObjectProcessor(aio, store, bucket_info, owner, obj_ctx, head_obj),
+ : ManifestObjectProcessor(aio, store, bucket_info, ptail_placement_rule,
+ owner, obj_ctx, head_obj),
olh_epoch(olh_epoch), unique_tag(unique_tag)
{}
public:
MultipartObjectProcessor(Aio *aio, RGWRados *store,
const RGWBucketInfo& bucket_info,
+ const string *ptail_placement_rule,
const rgw_user& owner, RGWObjectCtx& obj_ctx,
const rgw_obj& head_obj,
const std::string& upload_id, uint64_t part_num,
const std::string& part_num_str)
- : ManifestObjectProcessor(aio, store, bucket_info, owner, obj_ctx, head_obj),
+ : ManifestObjectProcessor(aio, store, bucket_info, ptail_placement_rule,
+ owner, obj_ctx, head_obj),
target_obj(head_obj), upload_id(upload_id),
part_num(part_num), part_num_str(part_num_str),
mp(head_obj.key.name, upload_id)
update_location();
}
-int RGWObjManifest::generator::create_begin(CephContext *cct, RGWObjManifest *_m, const string& placement_rule, const rgw_bucket& _b, const rgw_obj& _obj)
+int RGWObjManifest::generator::create_begin(CephContext *cct, RGWObjManifest *_m,
+ const string& head_placement_rule,
+ const string *tail_placement_rule,
+ const rgw_bucket& _b, const rgw_obj& _obj)
{
manifest = _m;
- manifest->set_tail_placement(placement_rule, _b);
- manifest->set_head(placement_rule, _obj, 0);
+ if (!tail_placement_rule) {
+ tail_placement_rule = &head_placement_rule;
+ }
+
+ manifest->set_tail_placement(*tail_placement_rule, _b);
+ manifest->set_head(head_placement_rule, _obj, 0);
last_ofs = 0;
if (manifest->get_prefix().empty()) {
obj,
dest_bucket_info,
bucket_info,
+ nullptr, /* const string *tail_rule */
NULL, /* time_t *src_mtime */
NULL, /* time_t *mtime */
NULL, /* const time_t *mod_ptr */
archive_obj, /* src obj */
bucket_info, /* dest bucket info */
archive_binfo, /* src bucket info */
+ nullptr, /* const string *ptail_rule */
nullptr, /* time_t *src_mtime */
nullptr, /* time_t *mtime */
nullptr, /* const time_t *mod_ptr */
attrset.erase(RGW_ATTR_ID_TAG);
attrset.erase(RGW_ATTR_TAIL_TAG);
- return copy_obj_data(rctx, dest_bucket_info, read_op, obj_size - 1, obj, NULL, mtime, attrset,
+ return copy_obj_data(rctx, dest_bucket_info, nullptr, read_op, obj_size - 1, obj, NULL, mtime, attrset,
0, real_time(), NULL);
}
rgw::AioThrottle aio(cct->_conf->rgw_put_obj_min_window_size);
using namespace rgw::putobj;
- AtomicObjectProcessor processor(&aio, this, dest_bucket_info, user_id,
+ string *ptail_rule{nullptr};
+#warning FIXME ptail_rule
+ AtomicObjectProcessor processor(&aio, this, dest_bucket_info, ptail_rule, user_id,
obj_ctx, dest_obj, olh_epoch, tag);
int ret = processor.prepare();
if (ret < 0) {
rgw_obj& src_obj,
RGWBucketInfo& dest_bucket_info,
RGWBucketInfo& src_bucket_info,
+ const string *ptail_rule,
real_time *src_mtime,
real_time *mtime,
const real_time *mod_ptr,
rgw_pool src_pool;
rgw_pool dest_pool;
- if (!get_obj_data_pool(src_bucket_info.placement_rule, src_obj, &src_pool)) {
+
+ const string *src_rule{nullptr};
+
+ if (astate->has_manifest) {
+ src_rule = &astate->manifest.get_tail_placement().placement_rule;
+ }
+
+ if (!src_rule || src_rule->empty()) {
+ src_rule = &src_bucket_info.placement_rule;
+ }
+
+ if (!ptail_rule) {
+ ptail_rule = &dest_bucket_info.placement_rule;
+ }
+
+ if (!get_obj_data_pool(*src_rule, src_obj, &src_pool)) {
ldout(cct, 0) << "ERROR: failed to locate data pool for " << src_obj << dendl;
return -EIO;
}
- if (!get_obj_data_pool(dest_bucket_info.placement_rule, dest_obj, &dest_pool)) {
+
+ if (!get_obj_data_pool(*ptail_rule, dest_obj, &dest_pool)) {
ldout(cct, 0) << "ERROR: failed to locate data pool for " << dest_obj << dendl;
return -EIO;
}
if (copy_data) { /* refcounting tail wouldn't work here, just copy the data */
attrs.erase(RGW_ATTR_TAIL_TAG);
- return copy_obj_data(obj_ctx, dest_bucket_info, read_op, obj_size - 1, dest_obj,
+ return copy_obj_data(obj_ctx, dest_bucket_info, ptail_rule, read_op, obj_size - 1, dest_obj,
mtime, real_time(), attrs, olh_epoch, delete_at, petag);
}
int RGWRados::copy_obj_data(RGWObjectCtx& obj_ctx,
RGWBucketInfo& dest_bucket_info,
+ const string *ptail_rule,
RGWRados::Object::Read& read_op, off_t end,
const rgw_obj& dest_obj,
real_time *mtime,
rgw::AioThrottle aio(cct->_conf->rgw_put_obj_min_window_size);
using namespace rgw::putobj;
- AtomicObjectProcessor processor(&aio, this, dest_bucket_info,
+ AtomicObjectProcessor processor(&aio, this, dest_bucket_info, ptail_rule,
dest_bucket_info.owner, obj_ctx,
dest_obj, olh_epoch, tag);
int ret = processor.prepare();
public:
generator() : manifest(NULL), last_ofs(0), cur_part_ofs(0), cur_part_id(0),
cur_stripe(0), cur_stripe_size(0) {}
- int create_begin(CephContext *cct, RGWObjManifest *manifest, const string& placement_rule, const rgw_bucket& bucket, const rgw_obj& obj);
+ int create_begin(CephContext *cct, RGWObjManifest *manifest,
+ const string& head_placement_rule,
+ const string *tail_placement_rule,
+ const rgw_bucket& bucket,
+ const rgw_obj& obj);
int create_next(uint64_t ofs);
rgw_obj& src_obj,
RGWBucketInfo& dest_bucket_info,
RGWBucketInfo& src_bucket_info,
+ const string *ptail_rule,
ceph::real_time *src_mtime,
ceph::real_time *mtime,
const ceph::real_time *mod_ptr,
int copy_obj_data(RGWObjectCtx& obj_ctx,
RGWBucketInfo& dest_bucket_info,
+ const string *ptail_rule,
RGWRados::Object::Read& read_op, off_t end,
const rgw_obj& dest_obj,
ceph::real_time *mtime,