summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2013-08-27 07:27:26 -0700
committerSamuel Just <sam.just@inktank.com>2013-09-06 16:06:00 -0700
commit53c7ab4db00ec7034f5aa555231f9ee167f43201 (patch)
treec367cebf995308f151df0e644190b34d7a9375f7
parent40dc489351383c2e35b91c3d4e76b633309716df (diff)
downloadceph-53c7ab4db00ec7034f5aa555231f9ee167f43201.tar.gz
PGLog: don't maintain log_keys_debug if the config is disabled
Fixes: #6040 Backport: Dumpling Signed-off-by: Samuel Just <sam.just@inktank.com> (cherry picked from commit 1c0d75db1075a58d893d30494a5d7280cb308899)
-rw-r--r--src/osd/PGLog.cc13
-rw-r--r--src/osd/PGLog.h12
2 files changed, 14 insertions, 11 deletions
diff --git a/src/osd/PGLog.cc b/src/osd/PGLog.cc
index dac1f33fd91..0e18710ad18 100644
--- a/src/osd/PGLog.cc
+++ b/src/osd/PGLog.cc
@@ -542,12 +542,13 @@ void PGLog::write_log(
<< ", dirty_from: " << dirty_from
<< ", dirty_divergent_priors: " << dirty_divergent_priors
<< dendl;
- _write_log(t, log, log_oid, divergent_priors,
- dirty_to,
- dirty_from,
- dirty_divergent_priors,
- !touched_log,
- &log_keys_debug);
+ _write_log(
+ t, log, log_oid, divergent_priors,
+ dirty_to,
+ dirty_from,
+ dirty_divergent_priors,
+ !touched_log,
+ (pg_log_debug ? &log_keys_debug : 0));
undirty();
} else {
dout(10) << "log is not dirty" << dendl;
diff --git a/src/osd/PGLog.h b/src/osd/PGLog.h
index 712c1e1c917..b524c60c00a 100644
--- a/src/osd/PGLog.h
+++ b/src/osd/PGLog.h
@@ -150,6 +150,7 @@ struct PGLog {
protected:
//////////////////// data members ////////////////////
+ bool pg_log_debug;
map<eversion_t, hobject_t> divergent_priors;
pg_missing_t missing;
@@ -205,10 +206,8 @@ protected:
log_keys_debug->erase(i++));
}
void check() {
- if (cct &&
- !(cct->_conf->osd_debug_pg_log_writeout)) {
+ if (!pg_log_debug)
return;
- }
assert(log.log.size() == log_keys_debug.size());
for (list<pg_log_entry_t>::iterator i = log.log.begin();
i != log.log.end();
@@ -226,6 +225,7 @@ protected:
}
public:
PGLog(CephContext *cct = 0) :
+ pg_log_debug(!(cct && !(cct->_conf->osd_debug_pg_log_writeout))),
touched_log(false), dirty_from(eversion_t::max()),
dirty_divergent_priors(false), cct(cct) {}
@@ -381,8 +381,10 @@ public:
bool read_log(ObjectStore *store, coll_t coll, hobject_t log_oid,
const pg_info_t &info, ostringstream &oss) {
- return read_log(store, coll, log_oid, info, divergent_priors,
- log, missing, oss, &log_keys_debug);
+ return read_log(
+ store, coll, log_oid, info, divergent_priors,
+ log, missing, oss,
+ (pg_log_debug ? &log_keys_debug : 0));
}
/// return true if the log should be rewritten