From: Sage Weil Date: Sat, 23 Feb 2013 00:48:02 +0000 (-0800) Subject: osd: allow pg log trim during (non-classic) scrub X-Git-Tag: v0.59~103 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0ba8db6b664205348d5499937759916eac0997bf;p=ceph.git 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 --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 4ff5242277b..c6617f853b0 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -3525,6 +3525,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 32e78a435a4..c7c63b725d0 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -834,6 +834,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) { @@ -869,6 +870,7 @@ public: map > authoritative; // classic scrub + bool classic; bool finalizing; // chunky scrub @@ -940,6 +942,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 3c449040f07..873c3d2b510 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -564,7 +564,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) {