]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: remove per-shard sync status object after incremental sync finishes wip-rgw-multisite-reshard-prebase-2021-09-27
authorShilpa Jagannath <smanjara@redhat.com>
Fri, 23 Jul 2021 06:58:24 +0000 (12:28 +0530)
committerCasey Bodley <cbodley@redhat.com>
Fri, 17 Sep 2021 19:14:02 +0000 (15:14 -0400)
Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_data_sync.cc

index 4112da06458a7f627bcf81f14283108d3a17373b..fd21966fd4f63e15f4ab14cd2135b57a7957143f 100644 (file)
@@ -3778,6 +3778,8 @@ public:
       stable_timestamp(stable_timestamp)
   {}
 
+  const rgw_raw_obj& get_obj() const { return obj; }
+
   RGWCoroutine* store_marker(const string& new_marker, uint64_t index_pos, const real_time& timestamp) override {
     sync_marker.position = new_marker;
     sync_marker.timestamp = timestamp;
@@ -4568,9 +4570,21 @@ int RGWBucketShardIncrementalSyncCR::operate(const DoutPrefixProvider *dpp)
       if (retcode < 0) {
         ldout(cct, 20) << "failed to update bucket sync status: "
             << cpp_strerror(retcode) << dendl;
-        drain_all();
         return set_cr_error(retcode);
       }
+      yield {
+        // delete the shard status object
+        auto status_obj = sync_env->svc->rados->obj(marker_tracker.get_obj());
+        retcode = status_obj.open(dpp);
+        if (retcode < 0) {
+          return set_cr_error(retcode);
+        }
+        call(new RGWRadosRemoveOidCR(sync_env->store, std::move(status_obj)));
+        if (retcode < 0) {
+          ldpp_dout(dpp, 20) << "failed to remove shard status object: " << cpp_strerror(retcode) << dendl;
+          return set_cr_error(retcode);
+        }
+      }
     }
 
     return set_cr_done();