]> 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>
Sun, 2 Sep 2018 11:40:23 +0000 (13:40 +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 27b8fe41fae3e419e4d45389e9870eb48d5b4f07..81e0319302f5c11b9654c000164a764806b26f42 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"
@@ -1993,6 +1996,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;
@@ -3216,6 +3225,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) {
         tn->log(0, SSTR("ERROR: init sync on bucket failed, retcode=" << retcode));
         lease_cr->go_down();