Merge pull request #3365 from liewegas/wip-peering

osd: new activating pg state between peering and active

Reviewed-by: Samuel Just <sjust@redhat.com>
This commit is contained in:
Samuel Just 2015-01-22 11:09:36 -08:00
commit 266cf2e5fa
3 changed files with 7 additions and 2 deletions

View File

@ -1688,6 +1688,8 @@ void PG::activate(ObjectStore::Transaction& t,
state_set(PG_STATE_DEGRADED); state_set(PG_STATE_DEGRADED);
state_set(PG_STATE_UNDERSIZED); 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); state_clear(PG_STATE_CREATING);
share_pg_info(); share_pg_info();
publish_stats_to_osd();
queue_peering_event( queue_peering_event(
CephPeeringEvtRef( CephPeeringEvtRef(
@ -6486,7 +6487,7 @@ boost::statechart::result PG::RecoveryState::Active::react(const AllReplicasActi
{ {
PG *pg = context< RecoveryMachine >().pg; PG *pg = context< RecoveryMachine >().pg;
all_replicas_activated = true; all_replicas_activated = true;
pg->state_clear(PG_STATE_ACTIVATING);
pg->state_set(PG_STATE_ACTIVE); pg->state_set(PG_STATE_ACTIVE);
pg->check_local(); pg->check_local();
@ -6509,6 +6510,7 @@ void PG::RecoveryState::Active::exit()
pg->backfill_reserved = false; pg->backfill_reserved = false;
pg->backfill_reserving = false; pg->backfill_reserving = false;
pg->state_clear(PG_STATE_ACTIVATING);
pg->state_clear(PG_STATE_DEGRADED); pg->state_clear(PG_STATE_DEGRADED);
pg->state_clear(PG_STATE_UNDERSIZED); pg->state_clear(PG_STATE_UNDERSIZED);
pg->state_clear(PG_STATE_BACKFILL_TOOFULL); pg->state_clear(PG_STATE_BACKFILL_TOOFULL);

View File

@ -700,6 +700,8 @@ std::string pg_state_string(int state)
oss << "creating+"; oss << "creating+";
if (state & PG_STATE_ACTIVE) if (state & PG_STATE_ACTIVE)
oss << "active+"; oss << "active+";
if (state & PG_STATE_ACTIVATING)
oss << "activating+";
if (state & PG_STATE_CLEAN) if (state & PG_STATE_CLEAN)
oss << "clean+"; oss << "clean+";
if (state & PG_STATE_RECOVERY_WAIT) if (state & PG_STATE_RECOVERY_WAIT)

View File

@ -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_BACKFILL_TOOFULL (1<<21) // backfill can't proceed: too full
#define PG_STATE_RECOVERY_WAIT (1<<22) // waiting for recovery reservations #define PG_STATE_RECOVERY_WAIT (1<<22) // waiting for recovery reservations
#define PG_STATE_UNDERSIZED (1<<23) // pg acting < pool size #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); std::string pg_state_string(int state);