From 43cf7707f0d298aef37b531e4a11c69f00433f51 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 26 Nov 2008 10:55:54 -0800 Subject: [PATCH] osd: (re)set degraded flag on activate This ensures the bit is properly set on newly created PGs.. --- src/osd/PG.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 8dfbe2cc18132..0c9334ccbb32f 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1134,7 +1134,12 @@ void PG::activate(ObjectStore::Transaction& t, state_clear(PG_STATE_CRASHED); state_clear(PG_STATE_REPLAY); } - + if (is_primary() && + info.pgid.size() != acting.size()) + state_set(PG_STATE_DEGRADED); + else + state_clear(PG_STATE_DEGRADED); + info.history.last_epoch_started = osd->osdmap->get_epoch(); trim_past_intervals(); -- 2.39.5