]> 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>
Mon, 13 Sep 2021 16:27:51 +0000 (12:27 -0400)
Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
src/rgw/rgw_data_sync.cc

index 01a039fc0d2a7d23a233a9945914cc6f54c81e60..9bf8cf1fcfe2c67783c7d5949f839865b85b1b1d 100644 (file)
@@ -2788,13 +2788,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;
@@ -5307,7 +5308,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) {
@@ -5337,6 +5342,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 {