]> 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>
Fri, 22 Jul 2016 05:22:11 +0000 (01:22 -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>
src/rgw/rgw_admin.cc
src/rgw/rgw_data_sync.cc

index addf36c579ab0c17ea8b7d3b3d7a3f9bc0cf5dc0..b457495e7f201b1048e4af6562dcbd10e2c8ea03 100644 (file)
@@ -1788,7 +1788,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;
   }
@@ -5091,7 +5091,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 d5ace03f37416fb7e44766b9dd2a49783c3daafa..568ee2727d2036cbb2d9d7d21b04ae10dbe81525 100644 (file)
@@ -639,11 +639,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)