]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: recover_primary() until primary has all found objects
authorSage Weil <sage@newdream.net>
Tue, 23 Nov 2010 21:16:52 +0000 (13:16 -0800)
committerSage Weil <sage@newdream.net>
Tue, 23 Nov 2010 21:52:22 +0000 (13:52 -0800)
The logic in that if was effectively reversed.

Signed-off-by: Sage Weil <sage@newdream.net>
src/osd/ReplicatedPG.cc

index 61aa10e26376198ca739986b1510776b5af039e3..e323b9bf6225d749498d0ea12d864f52af346eb3 100644 (file)
@@ -3625,21 +3625,19 @@ int ReplicatedPG::start_recovery_ops(int max)
 {
   int started = 0;
   assert(is_primary());
-  
-  size_t m_sz = missing.missing.size();
-  if (m_sz == 0) {
+
+  int num_missing = missing.num_missing();
+  int num_unfound = get_num_unfound();
+
+  if (num_missing == 0) {
     info.last_complete = info.last_update;
   }
 
-  size_t ml_sz = missing_loc.size();
-  assert(m_sz >= ml_sz);
-
-  if (m_sz == ml_sz) {
+  if (num_missing == num_unfound) {
     // All of the missing objects we have are unfound.
     // Recover the replicas.
     started = recover_replicas(max);
-  }
-  else {
+  } else {
     // We still have missing objects that we should grab from replicas.
     started = recover_primary(max);
   }