]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PeeringState.h: ignore MLogRec in Peering/GetInfo 33594/head
authorNeha Ojha <nojha@redhat.com>
Fri, 28 Feb 2020 02:17:21 +0000 (02:17 +0000)
committerNeha Ojha <nojha@redhat.com>
Fri, 28 Feb 2020 02:17:21 +0000 (02:17 +0000)
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 <nojha@redhat.com>
src/osd/PG.h

index d7c361389501a7257efccd96fccbfe921fabca68..be7a855228f22a1ed37cb14e8e34d2ff193ebd37 100644 (file)
@@ -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 > {