]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: return errors from RGWInitBucketShardSyncStatusCoroutine
authorCasey Bodley <cbodley@redhat.com>
Tue, 14 Aug 2018 17:06:50 +0000 (13:06 -0400)
committerNathan Cutler <ncutler@suse.com>
Fri, 28 Sep 2018 07:13:43 +0000 (09:13 +0200)
return ENOENT so caller can detect whether sync is stopped

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 72ac0aa1bb5bdffb06b1df8469206b3967a59aa0)

src/rgw/rgw_data_sync.cc

index 5aac1833bbe76a2912824037ad39ad2e84726e9a..2a95f6d131a3faa4e5c7c2ad08c8df1c261f6e8d 100644 (file)
@@ -1,3 +1,6 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
 #include <boost/utility/string_ref.hpp>
 
 #include "common/ceph_json.h"
@@ -1892,6 +1895,12 @@ public:
           call(new RGWSimpleRadosWriteAttrsCR(sync_env->async_rados, store, obj, attrs));
         }
       }
+      if (info.syncstopped) {
+        retcode = -ENOENT;
+      }
+      if (retcode < 0) {
+        return set_cr_error(retcode);
+      }
       return set_cr_done();
     }
     return 0;
@@ -3055,6 +3064,12 @@ int RGWRunBucketSyncCoroutine::operate()
 
     if (sync_status.state == rgw_bucket_shard_sync_info::StateInit) {
       yield call(new RGWInitBucketShardSyncStatusCoroutine(sync_env, bs, sync_status));
+      if (retcode == -ENOENT) {
+        tn->log(0, "bucket sync disabled");
+        lease_cr->go_down();
+        drain_all();
+        return set_cr_done();
+      }
       if (retcode < 0) {
         ldout(sync_env->cct, 0) << "ERROR: init sync on " << bucket_shard_str{bs}
             << " failed, retcode=" << retcode << dendl;