]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: do not queue the snap trimmer constantly
authorSamuel Just <sam.just@inktank.com>
Mon, 29 Sep 2014 23:26:54 +0000 (16:26 -0700)
committerSamuel Just <sam.just@inktank.com>
Mon, 27 Oct 2014 21:08:03 +0000 (14:08 -0700)
Previously, we continuously requeued the snap trimmer while in
TrimmingObjects.  This is not a good idea now that we try to
limit the number of snap trimming repops in flight and requeue
the snap trimmer directly as those repops complete.

Fixes: #9113
Backport: giant, dumpling, firefly
Signed-off-by: Samuel Just <sam.just@inktank.com>
(cherry picked from commit 34f38b68d89baf1dcbb4571d4f4d3076dc354538)

Conflicts:
src/osd/ReplicatedPG.cc

src/osd/ReplicatedPG.cc
src/osd/ReplicatedPG.h

index 5bd2e0c7fc6bcaf79f1bc3fb18fc1677c866f3bd..e0912b6154b5b5bd3703f67dbd32d02075a5f046 100644 (file)
@@ -1738,10 +1738,6 @@ void ReplicatedPG::snap_trimmer()
     // replica collection trimming
     snap_trimmer_machine.process_event(SnapTrim());
   }
-  if (snap_trimmer_machine.requeue) {
-    dout(10) << "snap_trimmer requeue" << dendl;
-    queue_snap_trim();
-  }
   unlock();
   return;
 }
@@ -7840,13 +7836,11 @@ void ReplicatedPG::SnapTrimmer::log_exit(const char *state_name, utime_t enter_t
 ReplicatedPG::NotTrimming::NotTrimming(my_context ctx) : my_base(ctx)
 {
   state_name = "NotTrimming";
-  context< SnapTrimmer >().requeue = false;
   context< SnapTrimmer >().log_enter(state_name);
 }
 
 void ReplicatedPG::NotTrimming::exit()
 {
-  context< SnapTrimmer >().requeue = true;
   context< SnapTrimmer >().log_exit(state_name, enter_time);
 }
 
@@ -7947,7 +7941,6 @@ ReplicatedPG::WaitingOnReplicas::WaitingOnReplicas(my_context ctx) : my_base(ctx
 {
   state_name = "Trimming/WaitingOnReplicas";
   context< SnapTrimmer >().log_enter(state_name);
-  context< SnapTrimmer >().requeue = false;
 }
 
 void ReplicatedPG::WaitingOnReplicas::exit()
index 6170977537479fbe399c17f8817276d8a0f28890..a2c3a3b90eb4195ecf2194448310ea35014900de 100644 (file)
@@ -996,8 +996,7 @@ private:
     set<RepGather *> repops;
     snapid_t snap_to_trim;
     bool need_share_pg_info;
-    bool requeue;
-    SnapTrimmer(ReplicatedPG *pg) : pg(pg), need_share_pg_info(false), requeue(false) {}
+    SnapTrimmer(ReplicatedPG *pg) : pg(pg), need_share_pg_info(false) {}
     ~SnapTrimmer();
     void log_enter(const char *state_name);
     void log_exit(const char *state_name, utime_t duration);