]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: rename Pending -> WaitActingChange
authorSage Weil <sage.weil@dreamhost.com>
Mon, 9 May 2011 22:56:20 +0000 (15:56 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Mon, 9 May 2011 23:01:49 +0000 (16:01 -0700)
We only use the Pending state while waiting for the acting set to change.
Rename the state and log it appropriately so we can see how much time the
OSD is spending doing this.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/osd/PG.cc
src/osd/PG.h

index 9051d9ec210f0d1ccdc87328fbc3569b90831240..9e0205fc50f55860be83acfe473d23e36595b2f2 100644 (file)
@@ -4409,6 +4409,17 @@ PG::RecoveryState::GetLog::~GetLog() {
     msg->put();
 }
 
+/*------WaitActingChange--------*/
+PG::RecoveryState::WaitActingChange::WaitActingChange(my_context ctx) : my_base(ctx)
+{
+  state_name = "Started/Primary/Peering/WaitActingChange";
+  context< RecoveryMachine >().log_enter(state_name);
+}
+
+void PG::RecoveryState::WaitActingChange::exit() {
+  context< RecoveryMachine >().log_exit(state_name, enter_time);
+}
+
 /*------GetMissing--------*/
 PG::RecoveryState::GetMissing::GetMissing(my_context ctx) : my_base(ctx)
 {
index 25eb58db1ca6d9d6839314800fe54bb8afd742d7..cad6e87c079b92aac06596e941405138446fe351 100644 (file)
@@ -1066,7 +1066,7 @@ public:
     };
 
     struct Peering;
-    struct Pending;
+    struct WaitActingChange;
     struct NeedNewMap : boost::statechart::event< NeedNewMap > {
       NeedNewMap() : boost::statechart::event< NeedNewMap >() {}
     };
@@ -1079,14 +1079,18 @@ public:
        boost::statechart::custom_reaction< ActMap >,
        boost::statechart::custom_reaction< BacklogComplete >,
        boost::statechart::custom_reaction< MNotifyRec >,
-       boost::statechart::transition< NeedNewMap, Pending >
+       boost::statechart::transition< NeedNewMap, WaitActingChange >
        > reactions;
       boost::statechart::result react(const BacklogComplete&);
       boost::statechart::result react(const ActMap&);
       boost::statechart::result react(const MNotifyRec&);
     };
 
-    struct Pending : boost::statechart::simple_state< Pending, Primary> {};
+    struct WaitActingChange : boost::statechart::state< WaitActingChange, Primary>,
+                             NamedState {
+      WaitActingChange(my_context ctx);
+      void exit();
+    };
     
     struct GetInfo;
     struct Active;