]> 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)
committerNathan Cutler <ncutler@suse.com>
Wed, 13 Jun 2018 10:15:43 +0000 (12:15 +0200)
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>
(cherry picked from commit 8d3b4ca591090a5ab3b5940f43a86866f2f5b9bc)

src/osd/PG.cc

index 173a51902dfcd4f1da28d3bc04171ea08caffe9d..80ae339a089ec205571a679716944094f7139de9 100644 (file)
@@ -5758,9 +5758,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)