PG: move most of all_activated_and_commited into the AllReplicasActivated handler

It's confusing to have that logic split up so much.

Signed-off-by: Samuel Just <sjust@redhat.com>
This commit is contained in:
Samuel Just 2014-11-20 15:50:50 -08:00
parent 5911b45011
commit e5a96fdbcd

View 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