From: Casey Bodley Date: Wed, 8 Jun 2016 15:24:11 +0000 (-0400) Subject: rgw: don't ignore ENOENT in RGWRemoteDataLog::read_sync_status() X-Git-Tag: v10.2.8~75^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=36921a3f3d01547508dc6270f6b19f2576e067d9;p=ceph.git rgw: don't ignore ENOENT in RGWRemoteDataLog::read_sync_status() 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 (cherry picked from commit 2cc533b30c0f23c0750ea8d02c51b3b3d3b4821a) --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 05c05620cbba..3f1fd490c3a9 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -1832,7 +1832,7 @@ static void get_data_sync_status(const string& source_zone, list& 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; } diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index de1f153d6a16..adb862c60979 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -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)