]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PrimaryLogPG: report ENOENT on missing clone on replica 32381/head
authorSamuel Just <sjust@redhat.com>
Wed, 18 Dec 2019 23:01:59 +0000 (15:01 -0800)
committerSamuel Just <sjust@redhat.com>
Fri, 20 Dec 2019 01:35:37 +0000 (17:35 -0800)
Can't check is_degraded_or_backfilling etc on replica.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/PrimaryLogPG.cc

index b7ce5dca3a61b4fe1adf7c56f65a44f3b42f6971..39d9fb4557668aa9b6ab67e3a2655faba992157f 100644 (file)
@@ -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;
     }
   }