From 3a3123033d7d9e1574be3fb18c807eeb0f4678eb Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 22 Feb 2013 16:48:02 -0800 Subject: [PATCH] osd: allow pg log trim during (non-classic) scrub Chunky (and deep) scrub do not care about PG log trimming. Classic scrub still does. Deep scrub can take a long time, so not trimming the log during that period may eat lots of RAM; avoid that! Might fix: #4179 Signed-off-by: Sage Weil Reviewed-by: Samuel Just (cherry picked from commit 0ba8db6b664205348d5499937759916eac0997bf) --- src/osd/PG.cc | 1 + src/osd/PG.h | 3 +++ src/osd/ReplicatedPG.cc | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 4aa6f5cb4f27e..a69dd5d20b590 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -3654,6 +3654,7 @@ void PG::classic_scrub() if (!scrubber.active) { dout(10) << "scrub start" << dendl; scrubber.active = true; + scrubber.classic = true; update_stats(); scrubber.received_maps.clear(); diff --git a/src/osd/PG.h b/src/osd/PG.h index f6dd8817f7276..70e2756a9bbb0 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -815,6 +815,7 @@ public: block_writes(false), active(false), queue_snap_trim(false), waiting_on(0), errors(0), fixed(0), active_rep_scrub(0), must_scrub(false), must_deep_scrub(false), must_repair(false), + classic(false), finalizing(false), is_chunky(false), state(INACTIVE), deep(false) { @@ -850,6 +851,7 @@ public: map > authoritative; // classic scrub + bool classic; bool finalizing; // chunky scrub @@ -921,6 +923,7 @@ public: // clear all state void reset() { + classic = false; finalizing = false; block_writes = false; active = false; diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index f67c2c323b42d..5dc0f1e398d7a 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -563,7 +563,7 @@ void ReplicatedPG::do_pg_op(OpRequestRef op) void ReplicatedPG::calc_trim_to() { - if (!is_degraded() && !is_scrubbing() && is_clean()) { + if (!is_degraded() && is_clean() && !(is_scrubbing() && scrubber.classic)) { if (min_last_complete_ondisk != eversion_t() && min_last_complete_ondisk != pg_trim_to && log.approx_size() > g_conf->osd_min_pg_log_entries) { -- 2.39.5