]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: move most of all_activated_and_commited into the AllReplicasActivated handler
authorSamuel Just <sjust@redhat.com>
Thu, 20 Nov 2014 23:50:50 +0000 (15:50 -0800)
committerSamuel Just <sjust@redhat.com>
Fri, 30 Jan 2015 19:45:37 +0000 (11:45 -0800)
It's confusing to have that logic split up so much.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/PG.cc

index d0783a6eed6e9d254eda9387288591a05c9a3895..c8b02b0dbfd48cf3a5b8fcbbc029aa0daa8accce 100644 (file)
@@ -1857,12 +1857,6 @@ void PG::all_activated_and_committed()
   assert(!actingbackfill.empty());
   assert(blocked_by.empty());
 
-  // info.last_epoch_started is set during activate()
-  info.history.last_epoch_started = info.last_epoch_started;
-  state_clear(PG_STATE_CREATING);
-
-  share_pg_info();
-
   queue_peering_event(
     CephPeeringEvtRef(
       new CephPeeringEvt(
@@ -6510,9 +6504,17 @@ boost::statechart::result PG::RecoveryState::Active::react(const AllReplicasActi
 {
   PG *pg = context< RecoveryMachine >().pg;
   all_replicas_activated = true;
+
   pg->state_clear(PG_STATE_ACTIVATING);
+  pg->state_clear(PG_STATE_CREATING);
   pg->state_set(PG_STATE_ACTIVE);
 
+  // info.last_epoch_started is set during activate()
+  pg->info.history.last_epoch_started = pg->info.last_epoch_started;
+
+  pg->share_pg_info();
+  pg->publish_stats_to_osd();
+
   pg->check_local();
 
   // waiters