Skip to content

Commit cdc2779

Browse files
authored
Merge pull request ceph#57060 from awojno-bloomberg/wip-awojno-status-header
rgw: implement x-amz-replication-status for PENDING & COMPLETED Reviewed-by: Shilpa Jagannath <[email protected]> Reviewed-by: Casey Bodley <[email protected]>
2 parents 1272408 + 4401be8 commit cdc2779

27 files changed

+191
-55
lines changed

src/rgw/driver/d4n/rgw_sal_d4n.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ int D4NFilterBucket::create(const DoutPrefixProvider* dpp,
111111
}
112112

113113
int D4NFilterObject::set_obj_attrs(const DoutPrefixProvider* dpp, Attrs* setattrs,
114-
Attrs* delattrs, optional_yield y)
114+
Attrs* delattrs, optional_yield y, uint32_t flags)
115115
{
116116
if (setattrs != NULL) {
117117
/* Ensure setattrs and delattrs do not overlap */
@@ -142,7 +142,7 @@ int D4NFilterObject::set_obj_attrs(const DoutPrefixProvider* dpp, Attrs* setattr
142142
ldpp_dout(dpp, 10) << "D4NFilterObject::" << __func__ << "(): CacheDriver delete_attrs method failed." << dendl;
143143
}
144144

145-
return next->set_obj_attrs(dpp, setattrs, delattrs, y);
145+
return next->set_obj_attrs(dpp, setattrs, delattrs, y, flags);
146146
}
147147

148148
int D4NFilterObject::get_obj_attrs(optional_yield y, const DoutPrefixProvider* dpp,

src/rgw/driver/d4n/rgw_sal_d4n.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class D4NFilterObject : public FilterObject {
179179

180180
virtual const std::string &get_name() const override { return next->get_name(); }
181181
virtual int set_obj_attrs(const DoutPrefixProvider* dpp, Attrs* setattrs,
182-
Attrs* delattrs, optional_yield y) override;
182+
Attrs* delattrs, optional_yield y, uint32_t flags) override;
183183
virtual int get_obj_attrs(optional_yield y, const DoutPrefixProvider* dpp,
184184
rgw_obj* target_obj = NULL) override;
185185
virtual int modify_obj_attrs(const char* attr_name, bufferlist& attr_val,

src/rgw/driver/daos/rgw_sal_daos.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ int DaosObject::load_obj_state(const DoutPrefixProvider* dpp,
898898
DaosObject::~DaosObject() { close(nullptr); }
899899

900900
int DaosObject::set_obj_attrs(const DoutPrefixProvider* dpp, Attrs* setattrs,
901-
Attrs* delattrs, optional_yield y) {
901+
Attrs* delattrs, optional_yield y, uint32_t flags) {
902902
ldpp_dout(dpp, 20) << "DEBUG: DaosObject::set_obj_attrs()" << dendl;
903903
// TODO handle target_obj
904904
// Get object's metadata (those stored in rgw_bucket_dir_entry)
@@ -957,7 +957,7 @@ int DaosObject::delete_obj_attrs(const DoutPrefixProvider* dpp,
957957
bufferlist bl;
958958

959959
rmattr[attr_name] = bl;
960-
return set_obj_attrs(dpp, nullptr, &rmattr, y);
960+
return set_obj_attrs(dpp, nullptr, &rmattr, y, rgw::sal::FLAG_LOG_OP);
961961
}
962962

963963
bool DaosObject::is_expired() {

src/rgw/driver/daos/rgw_sal_daos.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ class DaosObject : public StoreObject {
620620
virtual int load_obj_state(const DoutPrefixProvider *dpp, optional_yield y,
621621
bool follow_olh = true) override;
622622
virtual int set_obj_attrs(const DoutPrefixProvider* dpp, Attrs* setattrs,
623-
Attrs* delattrs, optional_yield y) override;
623+
Attrs* delattrs, optional_yield y, uint32_t flags) override;
624624
virtual int get_obj_attrs(optional_yield y, const DoutPrefixProvider* dpp,
625625
rgw_obj* target_obj = NULL) override;
626626
virtual int modify_obj_attrs(const char* attr_name, bufferlist& attr_val,

src/rgw/driver/motr/rgw_sal_motr.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,7 @@ MotrObject::~MotrObject() {
11821182
// return read_op.prepare(dpp);
11831183
// }
11841184

1185-
int MotrObject::set_obj_attrs(const DoutPrefixProvider* dpp, Attrs* setattrs, Attrs* delattrs, optional_yield y)
1185+
int MotrObject::set_obj_attrs(const DoutPrefixProvider* dpp, Attrs* setattrs, Attrs* delattrs, optional_yield y, uint32_t flags)
11861186
{
11871187
// TODO: implement
11881188
ldpp_dout(dpp, 20) <<__func__<< ": MotrObject::set_obj_attrs()" << dendl;
@@ -1238,7 +1238,7 @@ int MotrObject::modify_obj_attrs(const char* attr_name, bufferlist& attr_val, op
12381238
}
12391239
set_atomic();
12401240
state.attrset[attr_name] = attr_val;
1241-
return set_obj_attrs(dpp, &state.attrset, nullptr, y);
1241+
return set_obj_attrs(dpp, &state.attrset, nullptr, y, rgw::sal::FLAG_LOG_OP);
12421242
}
12431243

12441244
int MotrObject::delete_obj_attrs(const DoutPrefixProvider* dpp, const char* attr_name, optional_yield y)
@@ -1249,7 +1249,7 @@ int MotrObject::delete_obj_attrs(const DoutPrefixProvider* dpp, const char* attr
12491249

12501250
set_atomic();
12511251
rmattr[attr_name] = bl;
1252-
return set_obj_attrs(dpp, nullptr, &rmattr, y);
1252+
return set_obj_attrs(dpp, nullptr, &rmattr, y, rgw::sal::FLAG_LOG_OP);
12531253
}
12541254

12551255
bool MotrObject::is_expired() {

src/rgw/driver/motr/rgw_sal_motr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ class MotrObject : public StoreObject {
677677
virtual RGWAccessControlPolicy& get_acl(void) override { return acls; }
678678
virtual int set_acl(const RGWAccessControlPolicy& acl) override { acls = acl; return 0; }
679679
virtual int load_obj_state(const DoutPrefixProvider* dpp, optional_yield y, bool follow_olh = true) override;
680-
virtual int set_obj_attrs(const DoutPrefixProvider* dpp, Attrs* setattrs, Attrs* delattrs, optional_yield y) override;
680+
virtual int set_obj_attrs(const DoutPrefixProvider* dpp, Attrs* setattrs, Attrs* delattrs, optional_yield y, uint32_t flags) override;
681681
virtual int get_obj_attrs(optional_yield y, const DoutPrefixProvider* dpp, rgw_obj* target_obj = NULL) override;
682682
virtual int modify_obj_attrs(const char* attr_name, bufferlist& attr_val, optional_yield y, const DoutPrefixProvider* dpp) override;
683683
virtual int delete_obj_attrs(const DoutPrefixProvider* dpp, const char* attr_name, optional_yield y) override;

src/rgw/driver/posix/rgw_sal_posix.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,7 +1543,7 @@ int POSIXObject::load_obj_state(const DoutPrefixProvider* dpp, optional_yield y,
15431543
}
15441544

15451545
int POSIXObject::set_obj_attrs(const DoutPrefixProvider* dpp, Attrs* setattrs,
1546-
Attrs* delattrs, optional_yield y)
1546+
Attrs* delattrs, optional_yield y, uint32_t flags)
15471547
{
15481548
if (delattrs) {
15491549
for (auto& it : *delattrs) {
@@ -2408,7 +2408,7 @@ int POSIXObject::copy(const DoutPrefixProvider *dpp, optional_yield y,
24082408
return ret;
24092409
}
24102410

2411-
ret = dobj->set_obj_attrs(dpp, &get_attrs(), NULL, y);
2411+
ret = dobj->set_obj_attrs(dpp, &get_attrs(), NULL, y, rgw::sal::FLAG_LOG_OP);
24122412
if (ret < 0) {
24132413
ldpp_dout(dpp, 0) << "ERROR: could not write attrs to dest object "
24142414
<< dobj->get_name() << dendl;
@@ -2516,7 +2516,7 @@ int POSIXMultipartUpload::init(const DoutPrefixProvider *dpp, optional_yield y,
25162516

25172517
attrs[RGW_POSIX_ATTR_MPUPLOAD] = bl;
25182518

2519-
return meta_obj->set_obj_attrs(dpp, &attrs, nullptr, y);
2519+
return meta_obj->set_obj_attrs(dpp, &attrs, nullptr, y, rgw::sal::FLAG_LOG_OP);
25202520
}
25212521

25222522
int POSIXMultipartUpload::list_parts(const DoutPrefixProvider *dpp, CephContext *cct,

src/rgw/driver/posix/rgw_sal_posix.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ class POSIXObject : public StoreObject {
341341
virtual int set_acl(const RGWAccessControlPolicy& acl) override { acls = acl; return 0; }
342342
virtual int load_obj_state(const DoutPrefixProvider* dpp, optional_yield y, bool follow_olh = true) override;
343343
virtual int set_obj_attrs(const DoutPrefixProvider* dpp, Attrs* setattrs,
344-
Attrs* delattrs, optional_yield y) override;
344+
Attrs* delattrs, optional_yield y, uint32_t flags) override;
345345
virtual int get_obj_attrs(optional_yield y, const DoutPrefixProvider* dpp,
346346
rgw_obj* target_obj = NULL) override;
347347
virtual int modify_obj_attrs(const char* attr_name, bufferlist& attr_val,

src/rgw/driver/rados/rgw_bucket_sync.cc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,19 @@ void RGWBucketSyncPolicyHandler::get_pipes(std::set<rgw_sync_bucket_pipe> *_sour
984984
}
985985
}
986986

987+
bool RGWBucketSyncPolicyHandler::bucket_exports_object(const std::string& obj_name, const RGWObjTags& tags) const {
988+
if (bucket_exports_data()) {
989+
for (auto& entry : target_pipes.pipe_map) {
990+
auto& filter = entry.second.params.source.filter;
991+
if (filter.check_prefix(obj_name) && filter.check_tags(tags.get_tags())) {
992+
return true;
993+
}
994+
}
995+
}
996+
997+
return false;
998+
}
999+
9871000
bool RGWBucketSyncPolicyHandler::bucket_exports_data() const
9881001
{
9891002
if (!bucket) {

src/rgw/driver/rados/rgw_bucket_sync.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ class RGWBucketSyncPolicyHandler {
402402
return target_hints;
403403
}
404404

405+
bool bucket_exports_object(const std::string& obj_name, const RGWObjTags& tags) const;
405406
bool bucket_exports_data() const;
406407
bool bucket_imports_data() const;
407408

0 commit comments

Comments
 (0)