Skip to content

Commit

Permalink
rgw: allow object locator to be specified in cls_rgw_bucket_complete_op
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ivancich committed Aug 9, 2023
1 parent a66f828 commit 0865174
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/cls/rgw/cls_rgw_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<cls_rgw_obj_key> *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;
Expand All @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/cls/rgw/cls_rgw_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<cls_rgw_obj_key> *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<std::string>& keep_attr_prefixes);
void cls_rgw_obj_store_pg_ver(librados::ObjectWriteOperation& o, const std::string& attr);
Expand Down
2 changes: 1 addition & 1 deletion src/rgw/driver/rados/rgw_rados.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0865174

Please sign in to comment.