]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: only register for scrub if we are the PG primary 1396/head 1476/head
authorGuang Yang <yguang@yahoo-inc.com>
Thu, 6 Mar 2014 19:15:48 +0000 (11:15 -0800)
committerSage Weil <sage@inktank.com>
Thu, 6 Mar 2014 19:35:04 +0000 (11:35 -0800)
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 <yguang@yahoo-inc.com>
Signed-off-by: Sage Weil <sage@inktank.com>
src/osd/PG.cc

index 3537ce576accaed27fab3cbe6593b1197cef67aa..34a23bd0d4b247b8788c5dc834aba5885b1f1960 100644 (file)
@@ -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)