Skip to content

Commit

Permalink
osd/PG: discover unfound objects if PG is degraded
Browse files Browse the repository at this point in the history
When a PG is remapped from OSD `a` to OSD `b`, the objects are
backfilled. When OSD `a` is restarted, objects become degraded
as `a` is no longer queried or considered as a backfill source.

The discovery is done with `PG::discover_all_missing`, which is
called from `PG::activate` (which is not called since the PG is
already active), from `PG::find_unfound` (which is not called
as there are no unfound objects). It's also called from
`PG::RecoveryState::Active::react(const ActMap&)` and
`PG::RecoveryState::Active::react(const MNotifyRec& notevt)`
but only if there are unfound objects.

This patch introduces a call to `discover_all_missing` when
the PG is degraded. The degraded objects can be restored.

Fixes: https://tracker.ceph.com/issues/37439
Signed-off-by: Jonas Jelten <jj@stusta.net>
  • Loading branch information
TheJJ committed Apr 1, 2019
1 parent 4b86d98 commit 43b4a58
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/osd/PG.cc
Expand Up @@ -8505,7 +8505,7 @@ boost::statechart::result PG::RecoveryState::Active::react(const ActMap&)
ldout(pg->cct, 10) << "Active: handling ActMap" << dendl;
ceph_assert(pg->is_primary());

if (pg->have_unfound()) {
if (pg->have_unfound() || pg->is_degraded()) {
// object may have become unfound
pg->discover_all_missing(*context< RecoveryMachine >().get_query_map());
}
Expand Down Expand Up @@ -8558,7 +8558,7 @@ boost::statechart::result PG::RecoveryState::Active::react(const MNotifyRec& not
<< dendl;
pg->proc_replica_info(
notevt.from, notevt.notify.info, notevt.notify.epoch_sent);
if (pg->have_unfound()) {
if (pg->have_unfound() || pg->is_degraded()) {
pg->discover_all_missing(*context< RecoveryMachine >().get_query_map());
}
}
Expand Down

0 comments on commit 43b4a58

Please sign in to comment.