]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG.cc: Verify that recovery is truly complete
authorDavid Zafman <david.zafman@inktank.com>
Wed, 11 Sep 2013 23:56:21 +0000 (16:56 -0700)
committerDavid Zafman <david.zafman@inktank.com>
Thu, 12 Sep 2013 18:12:24 +0000 (11:12 -0700)
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>
src/osd/ReplicatedPG.cc

index 2456d1768340bdcf5cd2c7229cb0fb24e6e0082f..3cd5a7ef86545a131c8caed441862a35a3cba57b 100644 (file)
@@ -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()) {