summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ. Eric Ivancich <ivancich@redhat.com>2025-01-17 19:15:21 +0100
committerGitHub <noreply@github.com>2025-01-17 19:15:21 +0100
commit38b7027eaae4570849e855ce14b2b273311dd138 (patch)
tree4ec2002427823cffc635ebaa59bcb7beb9b60462
parentMerge pull request #61406 from clwluvw/checkpoint-dstbucket (diff)
parentrgw: update attrs with replication status to reflect in response (diff)
downloadceph-38b7027eaae4570849e855ce14b2b273311dd138.tar.xz
ceph-38b7027eaae4570849e855ce14b2b273311dd138.zip
Merge pull request #61407 from clwluvw/replication-status
rgw: update attrs with replication status to reflect in response Reviewed-by: Alex Wojno <awojno@bloomberg.net>
-rw-r--r--src/rgw/rgw_op.cc23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc
index 1793c0b8065..d6f846b0d2f 100644
--- a/src/rgw/rgw_op.cc
+++ b/src/rgw/rgw_op.cc
@@ -917,15 +917,20 @@ void handle_replication_status_header(
auto attr_iter = attrs.find(RGW_ATTR_OBJ_REPLICATION_STATUS);
if (attr_iter != attrs.end() && attr_iter->second.to_str() == "PENDING") {
if (s->object->is_sync_completed(dpp, obj_mtime)) {
- s->object->set_atomic();
- rgw::sal::Attrs setattrs, rmattrs;
- bufferlist bl;
- bl.append("COMPLETED");
- setattrs[RGW_ATTR_OBJ_REPLICATION_STATUS] = std::move(bl);
- int ret = s->object->set_obj_attrs(dpp, &setattrs, &rmattrs, s->yield, 0);
- if (ret == 0) {
- ldpp_dout(dpp, 20) << *s->object << " has amz-replication-status header set to COMPLETED" << dendl;
- }
+ s->object->set_atomic();
+ rgw::sal::Attrs setattrs, rmattrs;
+ bufferlist bl;
+ bl.append("COMPLETED");
+ setattrs[RGW_ATTR_OBJ_REPLICATION_STATUS] = bl;
+ int ret = s->object->set_obj_attrs(dpp, &setattrs, &rmattrs, s->yield, 0);
+ if (ret < 0) {
+ ldpp_dout(dpp, 0) << "ERROR: failed to set object replication status to COMPLETED ret=" << ret << dendl;
+ return;
+ }
+
+ ldpp_dout(dpp, 20) << *s->object << " has amz-replication-status header set to COMPLETED" << dendl;
+
+ attrs[RGW_ATTR_OBJ_REPLICATION_STATUS] = std::move(bl); // update the attrs so that the status is reflected in the response
}
}
}