]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/multisite: support enable right after disable
authorYuval Lifshitz <ylifshit@redhat.com>
Mon, 14 Jun 2021 14:03:35 +0000 (17:03 +0300)
committerAdam C. Emerson <aemerson@redhat.com>
Tue, 1 Feb 2022 20:50:46 +0000 (15:50 -0500)
Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
src/rgw/rgw_data_sync.cc

index 6ca1bace108b406503df38c0448882080e881288..afe9f5779bf2fa469d3a9a137ff1807c1146cf13 100644 (file)
@@ -2794,13 +2794,14 @@ public:
         status.encode_all_attrs(attrs);
         call(new RGWSimpleRadosWriteAttrsCR(dpp, sync_env->async_rados, sync_env->svc->sysobj,
                                             obj, attrs, &objv_tracker, exclusive));
-        ldout(cct, 20) << "init marker position: " << status.inc_marker.position << 
-          ". written to shard status object: " << sync_status_oid << dendl;
       }
 
       if (retcode < 0) {
+        ldout(cct, 20) << "ERROR: init marker position failed. error: " << retcode << dendl;
         return set_cr_error(retcode);
       }
+      ldout(cct, 20) << "init marker position: " << status.inc_marker.position << 
+        ". written to shard status object: " << sync_status_oid << dendl;
       return set_cr_done();
     }
     return 0;
@@ -5313,7 +5314,11 @@ int RGWSyncBucketCR::operate(const DoutPrefixProvider *dpp)
           RELEASE_LOCK(bucket_lease_cr);
           return set_cr_done();
                          }
-        bucket_stopped = false;
+        if (bucket_stopped) {
+          tn->log(20, SSTR("ERROR: switched from 'stop' to 'start' sync. while state is: " << bucket_status.state));
+          bucket_stopped = false;
+          bucket_status.state = BucketSyncState::Init;
+        }
       }
 
       if (bucket_status.state != BucketSyncState::Incremental) {
@@ -5343,6 +5348,7 @@ int RGWSyncBucketCR::operate(const DoutPrefixProvider *dpp)
           tn->log(20, SSTR("ERROR: reading the status after acquiring the lock failed. error: " << retcode));
           return set_cr_error(retcode);
         }
+        tn->log(20, SSTR("status after acquiring the lock is: " << bucket_status.state));
 
         // init sync status
         yield {