]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: reset last_complete on mark_all_unfound_as_lost if no more missing
authorSage Weil <sage.weil@dreamhost.com>
Sat, 7 May 2011 20:21:34 +0000 (13:21 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Mon, 9 May 2011 23:01:49 +0000 (16:01 -0700)
If we marked _all_ missing as lost, reset last_complete, since missing is
now empty!

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/osd/PG.cc

index 48c770328b38706451c73316be1c955a001f279c..046f75967698b869eb76216868e67c02a1e94b4e 100644 (file)
@@ -1131,6 +1131,12 @@ void PG::mark_all_unfound_as_lost(ObjectStore::Transaction& t)
   log.print(*_dout);
   *_dout << dendl;
 
+  if (missing.num_missing() == 0) {
+    // advance last_complete since nothing else is missing!
+    info.last_complete = info.last_update;
+    write_info(t);
+  }
+
   // Send out the PG log to all replicas
   // So that they know what is lost
   share_pg_log(old_last_update);
@@ -3961,8 +3967,7 @@ PG::RecoveryState::Active::react(const ActMap&) {
 
   if (pg->missing.num_missing() > pg->missing_loc.size()) {
     if (pg->all_unfound_are_lost(pg->osd->osdmap)) {
-      pg->mark_all_unfound_as_lost(
-       *context< RecoveryMachine >().get_cur_transaction());
+      pg->mark_all_unfound_as_lost(*context< RecoveryMachine >().get_cur_transaction());
     }
   }