]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: don't ignore ENOENT in RGWRemoteDataLog::read_sync_status()
authorCasey Bodley <cbodley@redhat.com>
Wed, 8 Jun 2016 15:24:11 +0000 (11:24 -0400)
committerCasey Bodley <cbodley@redhat.com>
Thu, 6 Apr 2017 19:03:06 +0000 (15:03 -0400)
rest handlers for sync status need to return ENOENT errors. the only
other callers are in radosgw-admin, so the ENOENT errors are ignored at
those call sites instead

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

src/rgw/rgw_admin.cc
src/rgw/rgw_data_sync.cc

index 05c05620cbbacac78b6fbb006e34a1305f616ead..3f1fd490c3a9aeecfcffe5e37cf48aed2ed97b5a 100644 (file)
@@ -1832,7 +1832,7 @@ static void get_data_sync_status(const string& source_zone, list<string>& status
   }
 
   ret = sync.read_sync_status();
-  if (ret < 0) {
+  if (ret < 0 && ret != -ENOENT) {
     push_ss(ss, status, tab) << string("failed read sync status: ") + cpp_strerror(-ret);
     return;
   }
@@ -5736,7 +5736,7 @@ next:
     }
 
     ret = sync.read_sync_status();
-    if (ret < 0) {
+    if (ret < 0 && ret != -ENOENT) {
       cerr << "ERROR: sync.read_sync_status() returned ret=" << ret << std::endl;
       return -ret;
     }
index de1f153d6a1640ce6631ae61327bfeeb3ef5d5cc..adb862c60979f9f90007b8426fb4fad6245329fb 100644 (file)
@@ -593,11 +593,7 @@ int RGWRemoteDataLog::get_shard_info(int shard_id)
 
 int RGWRemoteDataLog::read_sync_status(rgw_data_sync_status *sync_status)
 {
-  int r = run(new RGWReadDataSyncStatusCoroutine(&sync_env, sync_status));
-  if (r == -ENOENT) {
-    r = 0;
-  }
-  return r;
+  return run(new RGWReadDataSyncStatusCoroutine(&sync_env, sync_status));
 }
 
 int RGWRemoteDataLog::init_sync_status(int num_shards)