]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: drop messages from down peers
authorSamuel Just <sam.just@inktank.com>
Sun, 19 Jan 2014 09:17:49 +0000 (01:17 -0800)
committerSamuel Just <sam.just@inktank.com>
Wed, 22 Jan 2014 22:39:18 +0000 (14:39 -0800)
This overlaps with the existing old_peering_msg() mechanism
except in one case: pulls from a replica not in the acting
set.  If such a replica gets marked down, we may resend
pulls to another replica without causing a new interval
to start.  If we recieved, but didn't process, a push in
response to such a pull prior to processing the map marking
the peer down, we might process the push after having reset
the pull state for a different pull operation.  We can
avoid this by discarding ops from down peers.

Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/PG.cc

index d3887eda82f90ecce6f2cf388c9f32f19f900e31..84fa6483291fdde91a7fb91de15e8a5ca0c71d53 100644 (file)
@@ -4868,6 +4868,15 @@ bool PG::can_discard_replica_op(OpRequestRef op)
   T *m = static_cast<T *>(op->get_req());
   assert(m->get_header().type == MSGTYPE);
 
+  /* Mostly, this overlaps with the old_peering_msg
+   * condition.  An important exception is pushes
+   * sent by replicas not in the acting set, since
+   * if such a replica goes down it does not cause
+   * a new interval. */
+  int from = m->get_source().num();
+  if (get_osdmap()->get_down_at(from) >= m->map_epoch)
+    return true;
+
   // same pg?
   //  if pg changes _at all_, we reset and repeer!
   if (old_peering_msg(m->map_epoch, m->map_epoch)) {