]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix recovery_primary loop on local clone
authorSage Weil <sage@newdream.net>
Fri, 1 Oct 2010 05:00:06 +0000 (22:00 -0700)
committerSage Weil <sage@newdream.net>
Fri, 1 Oct 2010 05:00:06 +0000 (22:00 -0700)
When we take the clone branch, we update the missing map.  This invalidates
our current iterator, which can cause badness.  Instead, increment the
iterator near the top of the loop so we don't have to worry about it.

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

index 36d46e22772ecc066fa8f3ad2642d9856dce6348..f9b4da63570d9014b915a5ad9aff54fbaa9da062 100644 (file)
@@ -3878,6 +3878,7 @@ int ReplicatedPG::recover_primary(int max)
       soid = p->second;
     }
     Missing::item& item = missing.missing[p->second];
+    p++;
 
     sobject_t head = soid;
     head.snap = CEPH_NOSNAP;
@@ -3932,8 +3933,6 @@ int ReplicatedPG::recover_primary(int max)
       }
     }
     
-    p++;
-
     // only advance last_requested if we haven't skipped anything
     if (!skipped)
       log.last_requested = v;