]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: reset PG peering if osd transitions from down -> up
authorSage Weil <sage@redhat.com>
Thu, 7 Jun 2018 12:07:19 +0000 (07:07 -0500)
committerSage Weil <sage@redhat.com>
Thu, 7 Jun 2018 19:20:55 +0000 (14:20 -0500)
Consider a PG that is stray and ends up in ReplicaActive (because it is
participating as a recovery source).  If it is marked down wrongly and
then comes back up, then the PG will not reset, because there was not
an interval change (the PG is not part of the up or acting sets).
This can leave the PG in an odd state, leading to questionable behavior.
(For example, a stray might be in ReplicaActive and then ignore some
types of query messages.)

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PG.cc

index 97564c378ba61365e20884d943273418895220b0..3df79d54698d36415282aa5ec3ef7ecf55e2fc7e 100644 (file)
@@ -5765,9 +5765,12 @@ bool PG::should_restart_peering(
     dout(20) << "new interval newup " << newup
             << " newacting " << newacting << dendl;
     return true;
-  } else {
-    return false;
   }
+  if (!lastmap->is_up(osd->whoami) && osdmap->is_up(osd->whoami)) {
+    dout(10) << __func__ << " osd transitioned from down -> up" << dendl;
+    return true;
+  }
+  return false;
 }
 
 bool PG::old_peering_msg(epoch_t reply_epoch, epoch_t query_epoch)