]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: snap_trimmer should bail out while finalizing_scrub
authorSamuel Just <samuel.just@dreamhost.com>
Thu, 10 Feb 2011 23:45:22 +0000 (15:45 -0800)
committerSamuel Just <samuel.just@dreamhost.com>
Tue, 22 Feb 2011 23:09:40 +0000 (15:09 -0800)
Check to make sure !finalizing_scrub when relocking.

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
src/osd/ReplicatedPG.cc

index b243b579001077c0a46940cc15c510b065d5ba8b..e4bf9d4788fb13fcb890af12402983fa87cb9d62 100644 (file)
@@ -623,10 +623,11 @@ void ReplicatedPG::do_sub_op_reply(MOSDSubOpReply *r)
 bool ReplicatedPG::snap_trimmer()
 {
   lock();
-  if (!(is_primary() && is_clean() && is_active())) {
+  if (!(is_primary() && is_clean() && is_active() && !finalizing_scrub)) {
     unlock();
     return true;
   }
+
   dout(10) << "snap_trimmer start, purged_snaps " << info.purged_snaps << dendl;
 
   interval_set<snapid_t> s;
@@ -823,6 +824,12 @@ bool ReplicatedPG::snap_trimmer()
       // give other threads a chance at this pg
       unlock();
       lock();
+
+      if (finalizing_scrub) {
+       unlock();
+       return true;
+      }
+
       if (!(current_set_started == info.history.last_epoch_started &&
            is_active())) {
        break;
@@ -855,6 +862,10 @@ bool ReplicatedPG::snap_trimmer()
     // reflected when we scan the next collection set.
     osd->store->flush();
     lock();
+
+    if (finalizing_scrub) {
+      return true;
+    }
   }  
 
   // done