From: Guang Yang Date: Thu, 6 Mar 2014 19:15:48 +0000 (-0800) Subject: osd: only register for scrub if we are the PG primary X-Git-Tag: v0.79~121^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=173116faac50e7c5e596ddcf323b8edbe87bfaa2;p=ceph.git osd: only register for scrub if we are the PG primary There is no reason to put non-primary PGs on the scrub schedule as they will be ignored when the worker comes around. This reduces lock contention and is generally cleaner. Signed-off-by: Guang Yang Signed-off-by: Sage Weil --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 3537ce576acca..34a23bd0d4b24 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -3017,12 +3017,14 @@ void PG::reg_next_scrub() } else { scrubber.scrub_reg_stamp = info.history.last_scrub_stamp; } - osd->reg_last_pg_scrub(info.pgid, scrubber.scrub_reg_stamp); + if (is_primary()) + osd->reg_last_pg_scrub(info.pgid, scrubber.scrub_reg_stamp); } void PG::unreg_next_scrub() { - osd->unreg_last_pg_scrub(info.pgid, scrubber.scrub_reg_stamp); + if (is_primary()) + osd->unreg_last_pg_scrub(info.pgid, scrubber.scrub_reg_stamp); } void PG::sub_op_scrub_map(OpRequestRef op)