]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: remove per-shard sync status object after incremental sync finishes
authorShilpa Jagannath <smanjara@redhat.com>
Fri, 23 Jul 2021 06:58:24 +0000 (12:28 +0530)
committerAdam C. Emerson <aemerson@redhat.com>
Tue, 1 Feb 2022 22:47:51 +0000 (17:47 -0500)
Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_data_sync.cc

index daf632d43a93de12462f239fb6db1acfdab6ee00..13a93f0cebf40d80849a1dd423301d540a32a81b 100644 (file)
@@ -3784,6 +3784,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;
@@ -4574,9 +4576,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();