From 0865174cca641923c7b78fafd75acb597cb37399 Mon Sep 17 00:00:00 2001 From: "J. Eric Ivancich" Date: Mon, 22 May 2023 15:46:17 -0400 Subject: [PATCH] rgw: allow object locator to be specified in cls_rgw_bucket_complete_op When a tag is not specified in bucket operation (i.e., it's not transactional), the prepare function does not have to be called. But then there was no way to specify a locator for the object since that wasn't a parameter in the complete phase. This adds an object locator parameter to complete. Signed-off-by: J. Eric Ivancich --- src/cls/rgw/cls_rgw_client.cc | 4 +++- src/cls/rgw/cls_rgw_client.h | 3 ++- src/rgw/driver/rados/rgw_rados.cc | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/cls/rgw/cls_rgw_client.cc b/src/cls/rgw/cls_rgw_client.cc index 73a79490a2d5..5e7fba88f24a 100644 --- a/src/cls/rgw/cls_rgw_client.cc +++ b/src/cls/rgw/cls_rgw_client.cc @@ -286,7 +286,8 @@ void cls_rgw_bucket_complete_op(ObjectWriteOperation& o, RGWModifyOp op, const s const rgw_bucket_dir_entry_meta& dir_meta, const list *remove_objs, bool log_op, uint16_t bilog_flags, - const rgw_zone_set *zones_trace) + const rgw_zone_set *zones_trace, + const std::string& obj_locator) { bufferlist in; @@ -295,6 +296,7 @@ void cls_rgw_bucket_complete_op(ObjectWriteOperation& o, RGWModifyOp op, const s call.tag = tag; call.key = key; call.ver = ver; + call.locator = obj_locator; call.meta = dir_meta; call.log_op = log_op; call.bilog_flags = bilog_flags; diff --git a/src/cls/rgw/cls_rgw_client.h b/src/cls/rgw/cls_rgw_client.h index 139dbdb19395..1ae49c877bb4 100644 --- a/src/cls/rgw/cls_rgw_client.h +++ b/src/cls/rgw/cls_rgw_client.h @@ -355,7 +355,8 @@ void cls_rgw_bucket_complete_op(librados::ObjectWriteOperation& o, RGWModifyOp o const cls_rgw_obj_key& key, const rgw_bucket_dir_entry_meta& dir_meta, const std::list *remove_objs, bool log_op, - uint16_t bilog_op, const rgw_zone_set *zones_trace); + uint16_t bilog_op, const rgw_zone_set *zones_trace, + const std::string& obj_locator = ""); // ignored if it's the empty string void cls_rgw_remove_obj(librados::ObjectWriteOperation& o, std::list& keep_attr_prefixes); void cls_rgw_obj_store_pg_ver(librados::ObjectWriteOperation& o, const std::string& attr); diff --git a/src/rgw/driver/rados/rgw_rados.cc b/src/rgw/driver/rados/rgw_rados.cc index 09a762de29a4..bb17ff3c6317 100644 --- a/src/rgw/driver/rados/rgw_rados.cc +++ b/src/rgw/driver/rados/rgw_rados.cc @@ -8839,7 +8839,7 @@ int RGWRados::cls_obj_complete_op(BucketShard& bs, const rgw_obj& obj, RGWModify cls_rgw_obj_key key(ent.key.name, ent.key.instance); cls_rgw_guard_bucket_resharding(o, -ERR_BUSY_RESHARDING); cls_rgw_bucket_complete_op(o, op, tag, ver, key, dir_meta, remove_objs, - svc.zone->need_to_log_data(), bilog_flags, &zones_trace); + svc.zone->need_to_log_data(), bilog_flags, &zones_trace, obj.key.get_loc()); complete_op_data *arg; index_completion_manager->create_completion(obj, op, tag, ver, key, dir_meta, remove_objs, svc.zone->need_to_log_data(), bilog_flags, &zones_trace, &arg);