From 34f38b68d89baf1dcbb4571d4f4d3076dc354538 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Mon, 29 Sep 2014 16:26:54 -0700 Subject: [PATCH] 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 --- src/osd/ReplicatedPG.cc | 7 ------- src/osd/ReplicatedPG.h | 3 +-- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index de58ebefc58a1..5522d4dea3259 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -2544,10 +2544,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; } @@ -11823,13 +11819,11 @@ ReplicatedPG::NotTrimming::NotTrimming(my_context ctx) : my_base(ctx), NamedState(context< SnapTrimmer >().pg->cct, "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); } @@ -11936,7 +11930,6 @@ ReplicatedPG::WaitingOnReplicas::WaitingOnReplicas(my_context ctx) NamedState(context< SnapTrimmer >().pg->cct, "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 abee8bf57b67a..605f7f3d5ffba 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -1328,8 +1328,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); -- 2.39.5