88#include " rgw_coroutine.h"
99#include " rgw_sal.h"
1010#include " rgw_sal_rados.h"
11+ #include " rgw_bucket_sync.h"
1112#include " common/WorkQueue.h"
1213#include " common/Throttle.h"
1314
@@ -1129,6 +1130,7 @@ class RGWAsyncFetchRemoteObj : public RGWAsyncRadosRequest {
11291130 rgw_zone_set zones_trace;
11301131 PerfCounters* counters;
11311132 const DoutPrefixProvider *dpp;
1133+ bool keep_tags;
11321134
11331135protected:
11341136 int _send_request (const DoutPrefixProvider *dpp) override ;
@@ -1148,7 +1150,8 @@ class RGWAsyncFetchRemoteObj : public RGWAsyncRadosRequest {
11481150 const rgw_zone_set_entry& source_trace_entry,
11491151 rgw_zone_set *_zones_trace,
11501152 PerfCounters* counters,
1151- const DoutPrefixProvider *dpp)
1153+ const DoutPrefixProvider *dpp,
1154+ bool _keep_tags)
11521155 : RGWAsyncRadosRequest(caller, cn), store(_store),
11531156 source_zone (_source_zone),
11541157 user_id(_user_id),
@@ -1163,7 +1166,8 @@ class RGWAsyncFetchRemoteObj : public RGWAsyncRadosRequest {
11631166 stat_follow_olh(_stat_follow_olh),
11641167 source_trace_entry(source_trace_entry),
11651168 counters(counters),
1166- dpp(dpp)
1169+ dpp(dpp),
1170+ keep_tags(_keep_tags)
11671171 {
11681172 if (_zones_trace) {
11691173 zones_trace = *_zones_trace;
@@ -1199,6 +1203,7 @@ class RGWFetchRemoteObjCR : public RGWSimpleCoroutine {
11991203 rgw_zone_set *zones_trace;
12001204 PerfCounters* counters;
12011205 const DoutPrefixProvider *dpp;
1206+ bool keep_tags;
12021207
12031208public:
12041209 RGWFetchRemoteObjCR (RGWAsyncRadosProcessor *_async_rados, rgw::sal::RadosStore* _store,
@@ -1216,7 +1221,8 @@ class RGWFetchRemoteObjCR : public RGWSimpleCoroutine {
12161221 const rgw_zone_set_entry& source_trace_entry,
12171222 rgw_zone_set *_zones_trace,
12181223 PerfCounters* counters,
1219- const DoutPrefixProvider *dpp)
1224+ const DoutPrefixProvider *dpp,
1225+ bool _keep_tags)
12201226 : RGWSimpleCoroutine(_store->ctx ()), cct(_store->ctx ()),
12211227 async_rados(_async_rados), store(_store),
12221228 source_zone(_source_zone),
@@ -1232,7 +1238,7 @@ class RGWFetchRemoteObjCR : public RGWSimpleCoroutine {
12321238 req(NULL ),
12331239 stat_follow_olh(_stat_follow_olh),
12341240 source_trace_entry(source_trace_entry),
1235- zones_trace(_zones_trace), counters(counters), dpp(dpp) {}
1241+ zones_trace(_zones_trace), counters(counters), dpp(dpp), keep_tags(_keep_tags) {}
12361242
12371243
12381244 ~RGWFetchRemoteObjCR () override {
@@ -1250,7 +1256,7 @@ class RGWFetchRemoteObjCR : public RGWSimpleCoroutine {
12501256 req = new RGWAsyncFetchRemoteObj (this , stack->create_completion_notifier (), store,
12511257 source_zone, user_id, src_bucket, dest_placement_rule, dest_bucket_info,
12521258 key, dest_key, versioned_epoch, copy_if_newer, filter,
1253- stat_follow_olh, source_trace_entry, zones_trace, counters, dpp);
1259+ stat_follow_olh, source_trace_entry, zones_trace, counters, dpp, keep_tags );
12541260 async_rados->queue (req);
12551261 return 0 ;
12561262 }
@@ -1360,7 +1366,9 @@ class RGWStatRemoteObjCR : public RGWSimpleCoroutine {
13601366class RGWAsyncRemoveObj : public RGWAsyncRadosRequest {
13611367 const DoutPrefixProvider *dpp;
13621368 rgw::sal::RadosStore* store;
1369+ CephContext *cct;
13631370 rgw_zone_id source_zone;
1371+ rgw_bucket_sync_pipe& sync_pipe;
13641372
13651373 std::unique_ptr<rgw::sal::Bucket> bucket;
13661374 std::unique_ptr<rgw::sal::Object> obj;
@@ -1379,33 +1387,35 @@ class RGWAsyncRemoveObj : public RGWAsyncRadosRequest {
13791387 int _send_request (const DoutPrefixProvider *dpp) override ;
13801388public:
13811389 RGWAsyncRemoveObj (const DoutPrefixProvider *_dpp, RGWCoroutine *caller, RGWAioCompletionNotifier *cn,
1382- rgw::sal::RadosStore* _store,
1383- const rgw_zone_id& _source_zone,
1384- RGWBucketInfo& _bucket_info,
1385- const rgw_obj_key& _key,
1386- const std::string& _owner,
1387- const std::string& _owner_display_name,
1388- bool _versioned,
1389- uint64_t _versioned_epoch,
1390- bool _delete_marker,
1391- bool _if_older,
1392- real_time& _timestamp,
1393- rgw_zone_set* _zones_trace) : RGWAsyncRadosRequest(caller, cn), dpp(_dpp), store(_store),
1394- source_zone (_source_zone),
1395- owner(_owner),
1396- owner_display_name(_owner_display_name),
1397- versioned(_versioned),
1398- versioned_epoch(_versioned_epoch),
1399- del_if_older(_if_older),
1400- timestamp(_timestamp) {
1390+ rgw::sal::RadosStore* _store,
1391+ CephContext *_cct,
1392+ const rgw_zone_id& _source_zone,
1393+ rgw_bucket_sync_pipe& _sync_pipe,
1394+ const rgw_obj_key& _key,
1395+ const std::string& _owner,
1396+ const std::string& _owner_display_name,
1397+ bool _versioned,
1398+ uint64_t _versioned_epoch,
1399+ bool _delete_marker,
1400+ bool _if_older,
1401+ real_time& _timestamp,
1402+ rgw_zone_set* _zones_trace) : RGWAsyncRadosRequest(caller, cn), dpp(_dpp), store(_store), cct(_cct),
1403+ source_zone (_source_zone),
1404+ sync_pipe(_sync_pipe),
1405+ owner(_owner),
1406+ owner_display_name(_owner_display_name),
1407+ versioned(_versioned),
1408+ versioned_epoch(_versioned_epoch),
1409+ del_if_older(_if_older),
1410+ timestamp(_timestamp) {
14011411 if (_delete_marker) {
14021412 marker_version_id = _key.instance ;
14031413 }
14041414
14051415 if (_zones_trace) {
14061416 zones_trace = *_zones_trace;
14071417 }
1408- bucket = store->get_bucket (_bucket_info );
1418+ bucket = store->get_bucket (sync_pipe. dest_bucket_info );
14091419 obj = bucket->get_object (_key);
14101420 }
14111421};
@@ -1417,7 +1427,7 @@ class RGWRemoveObjCR : public RGWSimpleCoroutine {
14171427 rgw::sal::RadosStore* store;
14181428 rgw_zone_id source_zone;
14191429
1420- RGWBucketInfo bucket_info ;
1430+ rgw_bucket_sync_pipe& sync_pipe ;
14211431
14221432 rgw_obj_key key;
14231433 bool versioned;
@@ -1436,7 +1446,7 @@ class RGWRemoveObjCR : public RGWSimpleCoroutine {
14361446public:
14371447 RGWRemoveObjCR (const DoutPrefixProvider *_dpp, RGWAsyncRadosProcessor *_async_rados, rgw::sal::RadosStore* _store,
14381448 const rgw_zone_id& _source_zone,
1439- RGWBucketInfo& _bucket_info ,
1449+ rgw_bucket_sync_pipe& _sync_pipe ,
14401450 const rgw_obj_key& _key,
14411451 bool _versioned,
14421452 uint64_t _versioned_epoch,
@@ -1447,7 +1457,7 @@ class RGWRemoveObjCR : public RGWSimpleCoroutine {
14471457 rgw_zone_set *_zones_trace) : RGWSimpleCoroutine(_store->ctx ()), dpp(_dpp), cct(_store->ctx ()),
14481458 async_rados(_async_rados), store(_store),
14491459 source_zone(_source_zone),
1450- bucket_info(_bucket_info ),
1460+ sync_pipe(_sync_pipe ),
14511461 key(_key),
14521462 versioned(_versioned),
14531463 versioned_epoch(_versioned_epoch),
@@ -1477,7 +1487,7 @@ class RGWRemoveObjCR : public RGWSimpleCoroutine {
14771487 }
14781488
14791489 int send_request (const DoutPrefixProvider *dpp) override {
1480- req = new RGWAsyncRemoveObj (dpp, this , stack->create_completion_notifier (), store, source_zone, bucket_info ,
1490+ req = new RGWAsyncRemoveObj (dpp, this , stack->create_completion_notifier (), store, cct, source_zone, sync_pipe ,
14811491 key, owner, owner_display_name, versioned, versioned_epoch,
14821492 delete_marker, del_if_older, timestamp, zones_trace);
14831493 async_rados->queue (req);
0 commit comments