]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: Remove downed osds from peer_missing and peer_info
authorSage Weil <sage.weil@dreamhost.com>
Sat, 14 May 2011 20:46:09 +0000 (13:46 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Sat, 14 May 2011 20:46:09 +0000 (13:46 -0700)
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/osd/PG.cc
src/osd/PG.h

index 327b408337a1df97277a60b5cd8b06904659b0a9..c38999c412e845a99bb9136ebde4508eb2c77f3b 100644 (file)
@@ -3928,6 +3928,25 @@ PG::RecoveryState::Primary::react(const ActMap&) {
   return discard_event();
 }
 
+boost::statechart::result
+PG::RecoveryState::Primary::react(const AdvMap& advmap) 
+{
+  PG *pg = context< RecoveryMachine >().pg;
+  OSDMap &osdmap = advmap.osdmap;
+
+  // Remove any downed osds from peer_info
+  map<int,PG::Info>::iterator p = pg->peer_info.begin();
+  while (p != pg->peer_info.end()) {
+    if (!osdmap.is_up(p->first)) {
+      dout(10) << " dropping down osd" << p->first << " info " << p->second << dendl;
+      pg->peer_missing.erase(p->first);
+      pg->peer_info.erase(p++);
+    } else
+      p++;
+  }
+  return forward_event();
+}
+
 void PG::RecoveryState::Primary::exit() {
   context< RecoveryMachine >().log_exit(state_name, enter_time);
 }
index f360da37521b269f8f4ae660209be23ab0a57a7b..021ec3b1afd82aba7d30579ffecfdb5fb588ed93 100644 (file)
@@ -1079,10 +1079,12 @@ public:
        boost::statechart::custom_reaction< ActMap >,
        boost::statechart::custom_reaction< BacklogComplete >,
        boost::statechart::custom_reaction< MNotifyRec >,
+       boost::statechart::custom_reaction< AdvMap >,
        boost::statechart::transition< NeedNewMap, WaitActingChange >
        > reactions;
       boost::statechart::result react(const BacklogComplete&);
       boost::statechart::result react(const ActMap&);
+      boost::statechart::result react(const AdvMap&);
       boost::statechart::result react(const MNotifyRec&);
     };