]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: we might actually recover an object past crt on repair
authorSamuel Just <sjust@redhat.com>
Sat, 29 Oct 2016 22:00:57 +0000 (15:00 -0700)
committerSamuel Just <sjust@redhat.com>
Thu, 17 Nov 2016 18:41:34 +0000 (10:41 -0800)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/ReplicatedPG.cc

index 773dd8e7deb21561e338ab7525f3c26d9fc1d6d6..418a15875d9c4b06b4c233c2db5c262453e9766b 100644 (file)
@@ -362,6 +362,15 @@ void ReplicatedPG::on_local_recover(
   // keep track of active pushes for scrub
   ++active_pushes;
 
+  if (recovery_info.version > pg_log.get_can_rollback_to()) {
+    /* This can only happen during a repair, and even then, it would
+     * be one heck of a race.  If we are repairing the object, the
+     * write in question must be fully committed, so it's not valid
+     * to roll it back anyway (and we'll be rolled forward shortly
+     * anyway) */
+    PGLogEntryHandler h{this, t};
+    pg_log.roll_forward_to(recovery_info.version, &h);
+  }
   recover_got(recovery_info.soid, recovery_info.version);
 
   if (is_primary()) {