diff options
Diffstat (limited to 'src/osd')
-rw-r--r-- | src/osd/PG.cc | 2 | ||||
-rw-r--r-- | src/osd/PGLog.h | 10 |
2 files changed, 9 insertions, 3 deletions
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(); |