]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: use next_map to determine if peer is down 31293/head
authorMingxin Liu <mingxin@xsky.com>
Fri, 5 Jan 2018 10:00:36 +0000 (18:00 +0800)
committerNathan Cutler <ncutler@suse.com>
Thu, 31 Oct 2019 16:30:19 +0000 (17:30 +0100)
or peer was once down after this msg had been sent out

Signed-off-by: Mingxin Liu <mingxin@xsky.com>
(cherry picked from commit dc279bdd8675cf26a4517ac8399a84db510eb883)

src/osd/OSD.h
src/osd/PG.cc

index d60df55746019dc642a738a15b4cce7e5e50fc54..c8731b8f9d7073ec0c84e1805dae933489a76712 100644 (file)
@@ -519,6 +519,12 @@ public:
       }
     }
   }
+  OSDMapRef get_next_osdmap() {
+    Mutex::Locker l(pre_publish_lock);
+    if (!next_osdmap)
+      return OSDMapRef();
+    return next_osdmap;
+  }
 
 private:
   Mutex peer_map_epoch_lock;
index 289a97f2dedf4a79c366deb6e4569f74b666a679..7b9624267af23744918a35f0fca93b9386dadfce 100644 (file)
@@ -6207,14 +6207,15 @@ bool PG::can_discard_replica_op(OpRequestRef& op)
   // connection to it when handling the new osdmap marking it down, and also
   // resets the messenger sesssion when the replica reconnects. to avoid the
   // out-of-order replies, the messages from that replica should be discarded.
-  if (osd->get_osdmap()->is_down(from))
+  OSDMapRef next_map = osd->get_next_osdmap();
+  if (next_map->is_down(from))
     return true;
   /* 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. */
-  if (get_osdmap()->get_down_at(from) >= m->map_epoch)
+  if (next_map->get_down_at(from) >= m->map_epoch)
     return true;
 
   // same pg?