From: Neha Ojha Date: Fri, 28 Feb 2020 02:17:21 +0000 (+0000) Subject: osd/PeeringState.h: ignore MLogRec in Peering/GetInfo X-Git-Tag: v13.2.9~17^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F33594%2Fhead;p=ceph.git osd/PeeringState.h: ignore MLogRec in Peering/GetInfo It is possible to receive a response for an old GetLog request, after we've transitioned out of Started/Primary/Peering/GetLog due to a map change. Such cases are already handled in Nautilus and beyond, due to 168e20ab8b8da3a5aed41b73f9627d10971be67b, old_peering_evt() will detect such old responses by comparing last_peering_set with reply_epoch and query_epoch. In Mimic, query_epoch is not reliable and we may incorrectly start processing the MLogRec and crash the osd. Fixes: https://tracker.ceph.com/issues/44022 Signed-off-by: Neha Ojha --- diff --git a/src/osd/PG.h b/src/osd/PG.h index d7c361389501a..be7a855228f22 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -2633,10 +2633,16 @@ protected: boost::statechart::custom_reaction< QueryState >, boost::statechart::transition< GotInfo, GetLog >, boost::statechart::custom_reaction< MNotifyRec >, - boost::statechart::transition< IsDown, Down > + boost::statechart::transition< IsDown, Down >, + boost::statechart::custom_reaction< MLogRec > > reactions; boost::statechart::result react(const QueryState& q); boost::statechart::result react(const MNotifyRec& infoevt); + boost::statechart::result react(const MLogRec& evt) { + // If we end up receiving a response from a previous GetLog request when + // we have transitioned out of Peering/GetLog due to a map change, just ignore it. + return discard_event(); + } }; struct GotLog : boost::statechart::event< GotLog > {