From 0d3d75ec0d17e2f6bc5d42058f51eb2ff19ffb71 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 31 Jul 2012 14:01:57 -0700 Subject: [PATCH] osd: peering: detect when log source osd goes down The Peering state has a generic check based on the prior set osds that will restart peering if one of them goes down (or one of the interesting down ones comes up). The GetLog state, however, can pull the log from a peer that is not in the prior set if it got a notify from them (e.g., an osd in an old interval that was down when the prior set was calculated). If that osd goes down, we don't detect it and will block forward. Fix by adding a simple check in GetLog for the newest_update_osd going down. (BTW GetMissing does not suffer from this problem because peer_missing_requested is a subset of the prior set, so the Peering check is sufficient.) Signed-off-by: Sage Weil Reviewed-by: Samuel Just --- src/osd/PG.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 5b49ff7dfd912..99c8fdde06495 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -5231,6 +5231,21 @@ boost::statechart::result PG::RecoveryState::GetLog::react(const AdvMap& advmap) return forward_event(); } +boost::statechart::result PG::RecoveryState::GetLog::react(const AdvMap& advmap) +{ + // make sure our log source didn't go down. we need to check + // explicitly because it may not be part of the prior set, which + // means the Peering state check won't catch it going down. + if (!advmap.osdmap->is_up(newest_update_osd)) { + dout(10) << "GetLog: newest_update_osd osd." << newest_update_osd << " went down" << dendl; + post_event(advmap); + return transit< Reset >(); + } + + // let the Peering state do its checks. + return forward_event(); +} + boost::statechart::result PG::RecoveryState::GetLog::react(const MLogRec& logevt) { assert(!msg); -- 2.39.5