From: Sage Weil Date: Tue, 13 Jan 2015 15:55:16 +0000 (-0800) Subject: osd/PG: add 'activating' pg state between peering and active X-Git-Tag: v0.93~217^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=77bc23c3ac684516ffe4d93be91b82cfef41b4a0;p=ceph.git osd/PG: add 'activating' pg state between peering and active When peering completes we wait for everybody to commit the PG info before going active. The peering state is cleared but active is not set, which means the admin sees PGs in states like 'inactive', 'remapped', or other confusing names. Add an 'activating' state that bridges the gap. Signed-off-by: Sage Weil --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 8cc4e4eda3e7..e6d9e148d4d2 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1685,6 +1685,8 @@ void PG::activate(ObjectStore::Transaction& t, state_set(PG_STATE_DEGRADED); state_set(PG_STATE_UNDERSIZED); } + + state_set(PG_STATE_ACTIVATING); } } @@ -6469,7 +6471,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(); @@ -6492,6 +6494,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 55c3d73e8503..5fb799cbcffa 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 07b88aa6f989..f99dc57e5725 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -766,6 +766,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);