From 900bd37afb5b05c7170375bdbb2c083ff5b9f10d Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Wed, 18 Dec 2019 15:01:59 -0800 Subject: [PATCH] PrimaryLogPG: report ENOENT on missing clone on replica Can't check is_degraded_or_backfilling etc on replica. Signed-off-by: Samuel Just --- src/osd/PrimaryLogPG.cc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index b7ce5dca3a6..39d9fb45576 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; } } -- 2.39.5