From: Sage Weil Date: Tue, 8 Nov 2016 22:31:34 +0000 (-0500) Subject: osd: move pg logs into osd mempool X-Git-Tag: v11.1.0~325^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f54e6bd78c40fddea0d48564ba2a92a470d14f79;p=ceph.git osd: move pg logs into osd mempool Signed-off-by: Sage Weil --- diff --git a/src/messages/MOSDPGUpdateLogMissing.h b/src/messages/MOSDPGUpdateLogMissing.h index 35f33116e903..55e50d6a4626 100644 --- a/src/messages/MOSDPGUpdateLogMissing.h +++ b/src/messages/MOSDPGUpdateLogMissing.h @@ -29,7 +29,7 @@ public: spg_t pgid; shard_id_t from; ceph_tid_t rep_tid; - list entries; + mempool::osd::list entries; epoch_t get_epoch() const { return map_epoch; } spg_t get_pgid() const { return pgid; } @@ -39,7 +39,7 @@ public: MOSDPGUpdateLogMissing() : Message(MSG_OSD_PG_UPDATE_LOG_MISSING, HEAD_VERSION, COMPAT_VERSION) { } MOSDPGUpdateLogMissing( - const list &entries, + const mempool::osd::list &entries, spg_t pgid, shard_id_t from, epoch_t epoch, diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 01602e58c31d..36b7e36dd31f 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -77,7 +77,6 @@ const string biginfo_key("_biginfo"); const string epoch_key("_epoch"); const string fastinfo_key("_fastinfo"); - template static ostream& _prefix(std::ostream *_dout, T *t) { @@ -4639,7 +4638,7 @@ void PG::share_pg_info() } bool PG::append_log_entries_update_missing( - const list &entries, + const mempool::osd::list &entries, ObjectStore::Transaction &t) { assert(!entries.empty()); @@ -4667,7 +4666,7 @@ bool PG::append_log_entries_update_missing( void PG::merge_new_log_entries( - const list &entries, + const mempool::osd::list &entries, ObjectStore::Transaction &t) { dout(10) << __func__ << " " << entries << dendl; diff --git a/src/osd/PG.h b/src/osd/PG.h index 043a7c6e51e9..a1c41864d8a8 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -24,6 +24,7 @@ #include #include #include "include/memory.h" +#include "include/mempool.h" // re-include our assert to clobber boost's #include "include/assert.h" @@ -972,9 +973,9 @@ public: }; struct PGLogEntryHandler : public PGLog::LogEntryHandler { - list to_rollback; + mempool::osd::list to_rollback; set to_remove; - list to_trim; + mempool::osd::list to_trim; list > to_stash; // LogEntryHandler @@ -2296,7 +2297,7 @@ public: bool append_log_entries_update_missing( - const list &entries, + const mempool::osd::list &entries, ObjectStore::Transaction &t); /** @@ -2304,7 +2305,7 @@ public: * actingbackfill logs and missings (also missing_loc) */ void merge_new_log_entries( - const list &entries, + const mempool::osd::list &entries, ObjectStore::Transaction &t); void reset_interval_flush(); diff --git a/src/osd/PGLog.cc b/src/osd/PGLog.cc index 5bcdb9eee67e..3f9870fe9eb2 100644 --- a/src/osd/PGLog.cc +++ b/src/osd/PGLog.cc @@ -65,7 +65,7 @@ void PGLog::IndexedLog::split_into( unsigned split_bits, PGLog::IndexedLog *olog) { - list oldlog; + mempool::osd::list oldlog; oldlog.swap(log); eversion_t old_tail; @@ -242,7 +242,7 @@ void PGLog::proc_replica_log( log.tail : first_non_divergent->version; - list divergent; + mempool::osd::list divergent; list::const_iterator pp = olog.log.end(); while (true) { if (pp == olog.log.begin()) @@ -318,7 +318,7 @@ void PGLog::rewind_divergent_log(ObjectStore::Transaction& t, eversion_t newhead assert(newhead >= log.tail); list::iterator p = log.log.end(); - list divergent; + mempool::osd::list divergent; while (true) { if (p == log.log.begin()) { // yikes, the whole thing is divergent! @@ -451,7 +451,7 @@ void PGLog::merge_log(ObjectStore::Transaction& t, mark_dirty_from(lower_bound); // move aside divergent items - list divergent; + mempool::osd::list divergent; while (!log.empty()) { pg_log_entry_t &oe = *log.log.rbegin(); /* @@ -469,7 +469,7 @@ void PGLog::merge_log(ObjectStore::Transaction& t, log.log.pop_back(); } - list entries; + mempool::osd::list entries; entries.splice(entries.end(), olog.log, from, to); append_log_entries_update_missing( info.last_backfill, diff --git a/src/osd/PGLog.h b/src/osd/PGLog.h index 91a930cf4df9..ecf340fc75b2 100644 --- a/src/osd/PGLog.h +++ b/src/osd/PGLog.h @@ -18,7 +18,7 @@ #define CEPH_PG_LOG_H // re-include our assert to clobber boost's -#include "include/assert.h" +#include "include/assert.h" #include "osd_types.h" #include "os/ObjectStore.h" #include @@ -656,10 +656,10 @@ public: protected: static void split_by_object( - list &entries, - map, hobject_t::BitwiseComparator> *out_entries) { + mempool::osd::list &entries, + map, hobject_t::BitwiseComparator> *out_entries) { while (!entries.empty()) { - list &out_list = (*out_entries)[entries.front().soid]; + mempool::osd::list &out_list = (*out_entries)[entries.front().soid]; out_list.splice(out_list.end(), entries, entries.begin()); } } @@ -688,7 +688,7 @@ protected: static void _merge_object_divergent_entries( const IndexedLog &log, ///< [in] log to merge against const hobject_t &hoid, ///< [in] object we are merging - const list &entries, ///< [in] entries for hoid to merge + const mempool::osd::list &entries, ///< [in] entries for hoid to merge const pg_info_t &info, ///< [in] info for merging entries eversion_t olog_can_rollback_to, ///< [in] rollback boundary missing_type &missing, ///< [in,out] missing to adjust, use @@ -851,16 +851,16 @@ protected: template static void _merge_divergent_entries( const IndexedLog &log, ///< [in] log to merge against - list &entries, ///< [in] entries to merge + mempool::osd::list &entries, ///< [in] entries to merge const pg_info_t &oinfo, ///< [in] info for merging entries eversion_t olog_can_rollback_to, ///< [in] rollback boundary missing_type &omissing, ///< [in,out] missing to adjust, use LogEntryHandler *rollbacker, ///< [in] optional rollbacker object const DoutPrefixProvider *dpp ///< [in] logging provider ) { - map, hobject_t::BitwiseComparator > split; + map, hobject_t::BitwiseComparator > split; split_by_object(entries, &split); - for (map, hobject_t::BitwiseComparator>::iterator i = split.begin(); + for (map, hobject_t::BitwiseComparator>::iterator i = split.begin(); i != split.end(); ++i) { _merge_object_divergent_entries( @@ -884,7 +884,7 @@ protected: const pg_log_entry_t& oe, const pg_info_t& info, LogEntryHandler *rollbacker) { - list entries; + mempool::osd::list entries; entries.push_back(oe); _merge_object_divergent_entries( log, @@ -910,7 +910,7 @@ public: static bool append_log_entries_update_missing( const hobject_t &last_backfill, bool last_backfill_bitwise, - const list &entries, + const mempool::osd::list &entries, IndexedLog *log, missing_type &missing, LogEntryHandler *rollbacker, @@ -950,7 +950,7 @@ public: bool append_new_log_entries( const hobject_t &last_backfill, bool last_backfill_bitwise, - const list &entries, + const mempool::osd::list &entries, LogEntryHandler *rollbacker) { bool invalidate_stats = append_log_entries_update_missing( last_backfill, diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 05eed7b5d45d..23b03981eeaf 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -2311,7 +2311,7 @@ void ReplicatedPG::record_write_error(OpRequestRef op, const hobject_t &soid, assert(op->may_write()); const osd_reqid_t &reqid = static_cast(op->get_req())->get_reqid(); ObjectContextRef obc; - list entries; + mempool::osd::list entries; entries.push_back(pg_log_entry_t(pg_log_entry_t::ERROR, soid, get_next_version(), eversion_t(), 0, reqid, utime_t(), r)); @@ -8839,7 +8839,7 @@ void ReplicatedPG::simple_opc_submit(OpContextUPtr ctx) void ReplicatedPG::submit_log_entries( - const list &entries, + const mempool::osd::list &entries, ObcLockManager &&manager, boost::optional > &&on_complete, OpRequestRef op) @@ -9978,7 +9978,7 @@ void ReplicatedPG::mark_all_unfound_lost( pg_log.get_log().print(*_dout); *_dout << dendl; - list log_entries; + mempool::osd::list log_entries; utime_t mtime = ceph_clock_now(cct); map::const_iterator m = diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h index ae2b05ed9503..36c7bfbee2d1 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -850,7 +850,7 @@ protected: * Also used to store error log entries for dup detection. */ void submit_log_entries( - const list &entries, + const mempool::osd::list &entries, ObcLockManager &&manager, boost::optional > &&on_complete, OpRequestRef op = OpRequestRef()); diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index 5bf08c1c3965..c63a7f855981 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -26,6 +26,7 @@ #include #include "include/rados/rados_types.hpp" +#include "include/mempool.h" #include "msg/msg_types.h" #include "include/types.h" @@ -2873,7 +2874,7 @@ struct pg_log_t { // data can be found eversion_t rollback_info_trimmed_to; - list log; // the actual log. + mempool::osd::list log; // the actual log. pg_log_t() {}