summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2013-08-19 00:02:24 -0700
committerSamuel Just <sam.just@inktank.com>2013-08-19 00:04:13 -0700
commit0c4f2f34b78b634efe7f4d56694e2edeeda5a130 (patch)
tree3f7b88913a64f11dbeadbe20461d404b695dbc1e
parent290bcd8a718887eb0e28aa2d97bceeee79068ea9 (diff)
downloadceph-wip-dumpling-pglog-undirty.tar.gz
PGLog: add a config to disable PGLog::check()wip-dumpling-pglog-undirty
This is a debug check which may be causing excessive cpu usage. Signed-off-by: Samuel Just <sam.just@inktank.com>
-rw-r--r--src/common/config_opts.h3
-rw-r--r--src/osd/PG.cc2
-rw-r--r--src/osd/PGLog.h10
3 files changed, 12 insertions, 3 deletions
diff --git a/src/common/config_opts.h b/src/common/config_opts.h
index d933250f282..df206c007f4 100644
--- a/src/common/config_opts.h
+++ b/src/common/config_opts.h
@@ -483,6 +483,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, true)
+
/**
* osd_client_op_priority and osd_recovery_op_priority adjust the relative
* priority of client io vs recovery io.
diff --git a/src/osd/PG.cc b/src/osd/PG.cc
index 8e78eaa7a16..00c0c15d557 100644
--- a/src/osd/PG.cc
+++ b/src/osd/PG.cc
@@ -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),
diff --git a/src/osd/PGLog.h b/src/osd/PGLog.h
index 68317750332..955b9c18937 100644
--- a/src/osd/PGLog.h
+++ b/src/osd/PGLog.h
@@ -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();