string user_id;
char buf[16];
snprintf(buf, sizeof(buf), ".%lld", (long long)store->instance_id());
- string client_id = store->zone_id() + buf;
- string op_id = store->unique_id(store->get_new_req_id());
map<string, bufferlist> attrs;
rgw_obj src_obj(bucket_info.bucket, key);
int r = store->fetch_remote_obj(obj_ctx,
user_id,
- client_id,
- op_id,
- false, /* don't record op state in ops log */
NULL, /* req_info */
source_zone,
dest_obj,
string user_id;
char buf[16];
snprintf(buf, sizeof(buf), ".%lld", (long long)store->instance_id());
- string client_id = store->zone_id() + buf;
- string op_id = store->unique_id(store->get_new_req_id());
rgw_obj src_obj(bucket_info.bucket, key);
int r = store->stat_remote_obj(obj_ctx,
user_id,
- client_id,
nullptr, /* req_info */
source_zone,
src_obj,
return 0;
}
- string client_id;
- string op_id;
-
const string& src_name = obj.get_oid();
char buf[src_name.size() + 32];
struct timespec ts = ceph::real_clock::to_timespec(state->mtime);
r = copy_obj(obj_ctx,
user,
- client_id,
- op_id,
NULL, /* req_info *info */
no_zone,
dest_obj,
/* This code will be executed on latest version of the object. */
const auto handler = [&](const rgw_bucket_dir_entry& entry) -> int {
- std::string no_client_id;
- std::string no_op_id;
std::string no_zone;
/* We don't support object versioning of Swift API on those buckets that
int ret = copy_obj(obj_ctx,
user,
- no_client_id,
- no_op_id,
nullptr, /* req_info *info */
no_zone,
obj, /* dest obj */
int RGWRados::stat_remote_obj(RGWObjectCtx& obj_ctx,
const rgw_user& user_id,
- const string& client_id,
req_info *info,
const string& source_zone,
rgw_obj& src_obj,
int RGWRados::fetch_remote_obj(RGWObjectCtx& obj_ctx,
const rgw_user& user_id,
- const string& client_id,
- const string& op_id,
- bool record_op_state,
req_info *info,
const string& source_zone,
rgw_obj& dest_obj,
*/
int RGWRados::copy_obj(RGWObjectCtx& obj_ctx,
const rgw_user& user_id,
- const string& client_id,
- const string& op_id,
req_info *info,
const string& source_zone,
rgw_obj& dest_obj,
ldout(cct, 5) << "Copy object " << src_obj.bucket << ":" << src_obj.get_oid() << " => " << dest_obj.bucket << ":" << dest_obj.get_oid() << dendl;
if (remote_src || !source_zone.empty()) {
- return fetch_remote_obj(obj_ctx, user_id, client_id, op_id, true, info, source_zone,
+ return fetch_remote_obj(obj_ctx, user_id, info, source_zone,
dest_obj, src_obj, dest_bucket_info, src_bucket_info, src_mtime, mtime, mod_ptr,
unmod_ptr, high_precision_time,
if_match, if_nomatch, attrs_mod, copy_if_newer, attrs, category,
int stat_remote_obj(RGWObjectCtx& obj_ctx,
const rgw_user& user_id,
- const string& client_id,
req_info *info,
const string& source_zone,
rgw_obj& src_obj,
int fetch_remote_obj(RGWObjectCtx& obj_ctx,
const rgw_user& user_id,
- const string& client_id,
- const string& op_id,
- bool record_op_state,
req_info *info,
const string& source_zone,
rgw_obj& dest_obj,
*/
int copy_obj(RGWObjectCtx& obj_ctx,
const rgw_user& user_id,
- const string& client_id,
- const string& op_id,
req_info *info,
const string& source_zone,
rgw_obj& dest_obj,
if (s->system_request) {
source_zone = s->info.args.get(RGW_SYS_PARAM_PREFIX "source-zone");
s->info.args.get_bool(RGW_SYS_PARAM_PREFIX "copy-if-newer", ©_if_newer, false);
- if (!source_zone.empty()) {
- client_id = s->info.args.get(RGW_SYS_PARAM_PREFIX "client-id");
- op_id = s->info.args.get(RGW_SYS_PARAM_PREFIX "op-id");
-
- if (client_id.empty() || op_id.empty()) {
- ldout(s->cct, 0) <<
- RGW_SYS_PARAM_PREFIX "client-id or "
- RGW_SYS_PARAM_PREFIX "op-id were not provided, "
- "required for intra-region copy"
- << dendl;
- return -EINVAL;
- }
- }
}
copy_source = s->info.env->get("HTTP_X_AMZ_COPY_SOURCE");