We set degraded if we don't have enough "active" replicas, which excludes
the backfill target. We need to recheck that when we finish recovery and
the backfill target is now complete.
Fixes: #2160
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Reviewed-by: Josh Durgin <josh.durgin@dreamhost.com>
pg->state_clear(PG_STATE_BACKFILL);
pg->state_clear(PG_STATE_RECOVERING);
+ // if we finished backfill, all acting are active; recheck if
+ // DEGRADED is appropriate.
+ if (pg->get_osdmap()->get_pg_size(pg->info.pgid) <= pg->acting.size())
+ pg->state_clear(PG_STATE_DEGRADED);
+
// adjust acting set? (e.g. because backfill completed...)
if (pg->acting != pg->up &&
!pg->choose_acting(newest_update_osd)) {