]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG::snap_trimmer: requeue if scrub_block_writes
authorSamuel Just <sam.just@inktank.com>
Mon, 30 Jul 2012 20:36:39 +0000 (13:36 -0700)
committerSamuel Just <sam.just@inktank.com>
Mon, 30 Jul 2012 20:38:25 +0000 (13:38 -0700)
Otherwise, we do not continue snap_trimming once scrub is
complete.

Noticed while revewing another patch.  This would result
in snaps not being trimmed again until the next map
update.

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

index 79efb7cff81c5961898f40c6a122c8ae8d3b875a..684d361146b1d3097d24d7fc87502b09f8bf0b41 100644 (file)
@@ -1439,16 +1439,15 @@ void ReplicatedPG::snap_trimmer()
   dout(10) << "snap_trimmer entry" << dendl;
   if (is_primary()) {
     entity_inst_t nobody;
-    if (!mode.try_write(nobody)) {
+    if (!mode.try_write(nobody) || scrub_block_writes) {
       dout(10) << " can't write, requeueing" << dendl;
       queue_snap_trim();
       unlock();
       return;
     }
-    if (!scrub_block_writes) {
-      dout(10) << "snap_trimmer posting" << dendl;
-      snap_trimmer_machine.process_event(SnapTrim());
-    }
+
+    dout(10) << "snap_trimmer posting" << dendl;
+    snap_trimmer_machine.process_event(SnapTrim());
 
     if (snap_trimmer_machine.need_share_pg_info) {
       dout(10) << "snap_trimmer share_pg_info" << dendl;