From: Samuel Just Date: Mon, 29 Sep 2014 23:26:54 +0000 (-0700) Subject: ReplicatedPG: do not queue the snap trimmer constantly X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=01efc44adea6a16bed24fb10b67fe0cbd6a7595c;p=ceph.git ReplicatedPG: do not queue the snap trimmer constantly 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 (cherry picked from commit 34f38b68d89baf1dcbb4571d4f4d3076dc354538) Conflicts: src/osd/ReplicatedPG.cc --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 5bd2e0c7fc6b..e0912b6154b5 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -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() diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h index 617097753747..a2c3a3b90eb4 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -996,8 +996,7 @@ private: set 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);