]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: output recovery_state records for Down and Incomplete states
authorSage Weil <sage@redhat.com>
Thu, 22 Dec 2016 13:40:05 +0000 (08:40 -0500)
committerSage Weil <sage@redhat.com>
Thu, 22 Dec 2016 13:40:45 +0000 (08:40 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PG.cc
src/osd/PG.h

index aa6b386c79fa45212ea23b1e51fb9384ff61c3be..2e03e10be0e72e04cc0ae5074e956b7a600024df 100644 (file)
@@ -7721,6 +7721,17 @@ void PG::RecoveryState::Down::exit()
   pg->publish_stats_to_osd();
 }
 
+boost::statechart::result PG::RecoveryState::Down::react(const QueryState& q)
+{
+  q.f->open_object_section("state");
+  q.f->dump_string("name", state_name);
+  q.f->dump_stream("enter_time") << enter_time;
+  q.f->dump_string("comment",
+                  "not enough up instances of this PG to go active");
+  q.f->close_section();
+  return forward_event();
+}
+
 /*------Incomplete--------*/
 PG::RecoveryState::Incomplete::Incomplete(my_context ctx)
   : my_base(ctx),
@@ -7768,6 +7779,17 @@ boost::statechart::result PG::RecoveryState::Incomplete::react(const MNotifyRec&
   }
 }
 
+boost::statechart::result PG::RecoveryState::Incomplete::react(
+  const QueryState& q)
+{
+  q.f->open_object_section("state");
+  q.f->dump_string("name", state_name);
+  q.f->dump_stream("enter_time") << enter_time;
+  q.f->dump_string("comment", "not enough complete instances of this PG");
+  q.f->close_section();
+  return forward_event();
+}
+
 void PG::RecoveryState::Incomplete::exit()
 {
   context< RecoveryMachine >().log_exit(state_name, enter_time);
index 41c610980fb0861fa077afe5a50fe421b221e7c2..68e0840ab04375b86677965d4b25bb49cc7eb306 100644 (file)
@@ -1996,17 +1996,23 @@ public:
 
     struct Down : boost::statechart::state< Down, Peering>, NamedState {
       explicit Down(my_context ctx);
+      typedef boost::mpl::list <
+       boost::statechart::custom_reaction< QueryState >
+       > reactions;
+      boost::statechart::result react(const QueryState& infoevt);
       void exit();
     };
 
     struct Incomplete : boost::statechart::state< Incomplete, Peering>, NamedState {
       typedef boost::mpl::list <
        boost::statechart::custom_reaction< AdvMap >,
-       boost::statechart::custom_reaction< MNotifyRec >
+       boost::statechart::custom_reaction< MNotifyRec >,
+       boost::statechart::custom_reaction< QueryState >
        > reactions;
       explicit Incomplete(my_context ctx);
       boost::statechart::result react(const AdvMap &advmap);
       boost::statechart::result react(const MNotifyRec& infoevt);
+      boost::statechart::result react(const QueryState& infoevt);
       void exit();
     };