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: v11.0.1~24^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2cc533b30c0f23c0750ea8d02c51b3b3d3b4821a;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 --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index addf36c579a..b457495e7f2 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -1788,7 +1788,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; } @@ -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; } diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index d5ace03f374..568ee2727d2 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -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)