diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 54efd754d0a..1ec0112b9d4 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1688,6 +1688,8 @@ void PG::activate(ObjectStore::Transaction& t, state_set(PG_STATE_DEGRADED); state_set(PG_STATE_UNDERSIZED); } + + state_set(PG_STATE_ACTIVATING); } } @@ -1856,7 +1858,6 @@ void PG::all_activated_and_committed() state_clear(PG_STATE_CREATING); share_pg_info(); - publish_stats_to_osd(); queue_peering_event( CephPeeringEvtRef( @@ -6486,7 +6487,7 @@ 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_set(PG_STATE_ACTIVE); pg->check_local(); @@ -6509,6 +6510,7 @@ void PG::RecoveryState::Active::exit() pg->backfill_reserved = false; pg->backfill_reserving = false; + pg->state_clear(PG_STATE_ACTIVATING); pg->state_clear(PG_STATE_DEGRADED); pg->state_clear(PG_STATE_UNDERSIZED); pg->state_clear(PG_STATE_BACKFILL_TOOFULL); diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index a3c94ff1afd..324dd45b7ad 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -700,6 +700,8 @@ std::string pg_state_string(int state) oss << "creating+"; if (state & PG_STATE_ACTIVE) oss << "active+"; + if (state & PG_STATE_ACTIVATING) + oss << "activating+"; if (state & PG_STATE_CLEAN) oss << "clean+"; if (state & PG_STATE_RECOVERY_WAIT) diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index 242cad5fd22..10728fa6c60 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -767,6 +767,7 @@ inline ostream& operator<<(ostream& out, const osd_stat_t& s) { #define PG_STATE_BACKFILL_TOOFULL (1<<21) // backfill can't proceed: too full #define PG_STATE_RECOVERY_WAIT (1<<22) // waiting for recovery reservations #define PG_STATE_UNDERSIZED (1<<23) // pg acting < pool size +#define PG_STATE_ACTIVATING (1<<24) // pg is peered but not yet active std::string pg_state_string(int state);