From: David Zafman Date: Wed, 11 Sep 2013 23:56:21 +0000 (-0700) Subject: osd/ReplicatedPG.cc: Verify that recovery is truly complete X-Git-Tag: v0.71~131^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=daf417f9ccc9181c549ad2d4a19b16b0c3caf85f;p=ceph.git osd/ReplicatedPG.cc: Verify that recovery is truly complete Backportable change to insure that even if no new ops started or are running that indeed recovery is complete. Prevents some error condition or unforseen code path from crashing an osd. Backport: dumpling, cuttlefish Signed-off-by: David Zafman Reviewed-by: Samuel Just --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 2456d1768340..3cd5a7ef8654 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -7293,6 +7293,13 @@ int ReplicatedPG::start_recovery_ops( return started; } + if (needs_recovery()) { + // this shouldn't happen! + // We already checked num_missing() so we must have missing replicas + osd->clog.error() << info.pgid << " recovery ending with missing replicas\n"; + return started; + } + if (state_test(PG_STATE_RECOVERING)) { state_clear(PG_STATE_RECOVERING); if (needs_backfill()) {