]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PGLog: add a config to disable PGLog::check()
authorSamuel Just <sam.just@inktank.com>
Mon, 19 Aug 2013 07:02:24 +0000 (00:02 -0700)
committerSamuel Just <sam.just@inktank.com>
Tue, 20 Aug 2013 01:04:55 +0000 (18:04 -0700)
This is a debug check which may be causing excessive
cpu usage.

Reviewed-by: Sage Weil <sage@inktank.com>
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/common/config_opts.h
src/osd/PG.cc
src/osd/PGLog.h

index d3e21105e791d4f2603406384c30777bd7f38391..b021651bd4d55e79a52d41511d6831ad43a017c3 100644 (file)
@@ -491,6 +491,9 @@ OPTION(osd_leveldb_compression, OPT_BOOL, true) // OSD's leveldb uses compressio
 OPTION(osd_leveldb_paranoid, OPT_BOOL, false) // OSD's leveldb paranoid flag
 OPTION(osd_leveldb_log, OPT_STR, "")  // enable OSD leveldb log file
 
+// determines whether PGLog::check() compares written out log to stored log
+OPTION(osd_debug_pg_log_writeout, OPT_BOOL, false)
+
 /**
  * osd_client_op_priority and osd_recovery_op_priority adjust the relative
  * priority of client io vs recovery io.
index 63be6a34b03af9de11115bd89a2fa5dfbcc63b09..5d6cdca9b6aa80ba84bf924da720d5e0466b84e0 100644 (file)
@@ -158,7 +158,7 @@ PG::PG(OSDService *o, OSDMapRef curmap,
   deleting(false), dirty_info(false), dirty_big_info(false),
   info(p),
   info_struct_v(0),
-  coll(p), log_oid(loid), biginfo_oid(ioid),
+  coll(p), pg_log(g_ceph_context), log_oid(loid), biginfo_oid(ioid),
   recovery_item(this), scrub_item(this), scrub_finalize_item(this), snap_trim_item(this), stat_queue_item(this),
   recovery_ops_active(0),
   waiting_on_backfill(0),
index 6831775033221949353c271cfbcdd934c8794372..955b9c18937d72466f2f5296cf7a9d8e00a517ad 100644 (file)
@@ -21,6 +21,7 @@
 #include "include/assert.h" 
 #include "osd_types.h"
 #include "os/ObjectStore.h"
+#include "common/ceph_context.h"
 #include <list>
 using namespace std;
 
@@ -159,6 +160,7 @@ protected:
   eversion_t dirty_to;
   eversion_t dirty_from;
   bool dirty_divergent_priors;
+  CephContext *cct;
 
   bool is_dirty() const {
     return !touched_log ||
@@ -197,6 +199,10 @@ protected:
   }
   void check() {
     assert(log.log.size() == log_keys_debug.size());
+    if (cct &&
+        !(cct->_conf->osd_debug_pg_log_writeout)) {
+      return;
+    }
     for (list<pg_log_entry_t>::iterator i = log.log.begin();
         i != log.log.end();
         ++i) {
@@ -212,9 +218,9 @@ protected:
     check();
   }
 public:
-  PGLog() :
+  PGLog(CephContext *cct = 0) :
     touched_log(false), dirty_from(eversion_t::max()),
-    dirty_divergent_priors(false) {}
+    dirty_divergent_priors(false), cct(cct) {}
 
 
   void reset_backfill();