From: Samuel Just Date: Wed, 18 Dec 2019 23:01:59 +0000 (-0800) Subject: PrimaryLogPG: report ENOENT on missing clone on replica X-Git-Tag: v15.1.0~411^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=900bd37afb5b05c7170375bdbb2c083ff5b9f10d;p=ceph.git PrimaryLogPG: report ENOENT on missing clone on replica Can't check is_degraded_or_backfilling etc on replica. Signed-off-by: Samuel Just --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index b7ce5dca3a61..39d9fb455766 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -11266,14 +11266,19 @@ int PrimaryLogPG::find_object_context(const hobject_t& oid, if (pmissing) *pmissing = soid; put_snapset_context(ssc); - if (is_degraded_or_backfilling_object(soid)) { - dout(20) << __func__ << " clone is degraded or backfilling " << soid << dendl; - return -EAGAIN; - } else if (is_degraded_on_async_recovery_target(soid)) { - dout(20) << __func__ << " clone is recovering " << soid << dendl; - return -EAGAIN; + if (is_primary()) { + if (is_degraded_or_backfilling_object(soid)) { + dout(20) << __func__ << " clone is degraded or backfilling " << soid << dendl; + return -EAGAIN; + } else if (is_degraded_on_async_recovery_target(soid)) { + dout(20) << __func__ << " clone is recovering " << soid << dendl; + return -EAGAIN; + } else { + dout(20) << __func__ << " missing clone " << soid << dendl; + return -ENOENT; + } } else { - dout(20) << __func__ << " missing clone " << soid << dendl; + dout(20) << __func__ << " replica missing clone" << soid << dendl; return -ENOENT; } }