summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Zafman <david.zafman@inktank.com>2013-09-11 16:56:21 -0700
committerDavid Zafman <david.zafman@inktank.com>2013-09-12 11:12:24 -0700
commitdaf417f9ccc9181c549ad2d4a19b16b0c3caf85f (patch)
treee4b8193188a74a3bf78ac5705e4c55670d475941
parent139a714e13aa3c7f42091270b55dde8a17b3c4b8 (diff)
downloadceph-daf417f9ccc9181c549ad2d4a19b16b0c3caf85f.tar.gz
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 <david.zafman@inktank.com> Reviewed-by: Samuel Just <sam.just@inktank.com>
-rw-r--r--src/osd/ReplicatedPG.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc
index 2456d176834..3cd5a7ef865 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()) {