From: Samuel Just Date: Tue, 10 May 2016 21:03:03 +0000 (-0700) Subject: PGLog: s/read_log/read_log_and_missing/g X-Git-Tag: ses5-milestone5~325^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3fc1c7e3fdfafb4a960647d76813fe4e92af41eb;p=ceph.git PGLog: s/read_log/read_log_and_missing/g Signed-off-by: Samuel Just --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 6b38a8814da..7879467e43e 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -68,7 +68,7 @@ #undef dout_prefix #define dout_prefix _prefix(_dout, this) -// prefix pgmeta_oid keys with _ so that PGLog::read_log() can +// prefix pgmeta_oid keys with _ so that PGLog::read_log_and_missing() can // easily skip them const string infover_key("_infover"); const string info_key("_info"); @@ -3121,7 +3121,7 @@ void PG::read_state(ObjectStore *store, bufferlist &bl) assert(r >= 0); ostringstream oss; - pg_log.read_log(store, + pg_log.read_log_and_missing(store, coll, info_struct_v < 8 ? coll_t::meta() : coll, ghobject_t(info_struct_v < 8 ? OSD::make_pg_log_oid(pg_id) : pgmeta_oid), diff --git a/src/osd/PGLog.h b/src/osd/PGLog.h index 09e157e3bf5..03c99cbff3c 100644 --- a/src/osd/PGLog.h +++ b/src/osd/PGLog.h @@ -59,10 +59,10 @@ struct PGLog : DoutPrefixProvider { }; /* Exceptions */ - class read_log_error : public buffer::error { + class read_log_and_missing_error : public buffer::error { public: - explicit read_log_error(const char *what) { - snprintf(buf, sizeof(buf), "read_log_error: %s", what); + explicit read_log_and_missing_error(const char *what) { + snprintf(buf, sizeof(buf), "read_log_and_missing_error: %s", what); } const char *what() const throw () { return buf; @@ -1031,10 +1031,10 @@ public: set *log_keys_debug ); - void read_log(ObjectStore *store, coll_t pg_coll, + void read_log_and_missing(ObjectStore *store, coll_t pg_coll, coll_t log_coll, ghobject_t log_oid, const pg_info_t &info, ostringstream &oss) { - return read_log( + return read_log_and_missing( store, pg_coll, log_coll, log_oid, info, divergent_priors, log, missing, oss, this, @@ -1042,7 +1042,7 @@ public: } template - static void read_log(ObjectStore *store, coll_t pg_coll, + static void read_log_and_missing(ObjectStore *store, coll_t pg_coll, coll_t log_coll, ghobject_t log_oid, const pg_info_t &info, map &divergent_priors, IndexedLog &log, @@ -1050,7 +1050,7 @@ public: const DoutPrefixProvider *dpp = NULL, set *log_keys_debug = 0 ) { - ldpp_dout(dpp, 20) << "read_log coll " << pg_coll + ldpp_dout(dpp, 20) << "read_log_and_missing coll " << pg_coll << " log_oid " << log_oid << dendl; // legacy? @@ -1073,7 +1073,7 @@ public: bufferlist::iterator bp = bl.begin(); if (p->key() == "divergent_priors") { ::decode(divergent_priors, bp); - ldpp_dout(dpp, 20) << "read_log " << divergent_priors.size() + ldpp_dout(dpp, 20) << "read_log_and_missing " << divergent_priors.size() << " divergent_priors" << dendl; } else if (p->key() == "can_rollback_to") { ::decode(log.can_rollback_to, bp); @@ -1082,7 +1082,7 @@ public: } else { pg_log_entry_t e; e.decode_with_checksum(bp); - ldpp_dout(dpp, 20) << "read_log " << e << dendl; + ldpp_dout(dpp, 20) << "read_log_and_missing " << e << dendl; if (!log.log.empty()) { pg_log_entry_t last_e(log.log.back()); assert(last_e.version.version < e.version.version); @@ -1100,7 +1100,7 @@ public: // build missing if (info.last_complete < info.last_update) { - ldpp_dout(dpp, 10) << "read_log checking for missing items over interval (" + ldpp_dout(dpp, 10) << "read_log_and_missing checking for missing items over interval (" << info.last_complete << "," << info.last_update << "]" << dendl; @@ -1127,12 +1127,12 @@ public: if (r >= 0) { object_info_t oi(bv); if (oi.version < i->version) { - ldpp_dout(dpp, 15) << "read_log missing " << *i + ldpp_dout(dpp, 15) << "read_log_and_missing missing " << *i << " (have " << oi.version << ")" << dendl; missing.add(i->soid, i->version, oi.version); } } else { - ldpp_dout(dpp, 15) << "read_log missing " << *i << dendl; + ldpp_dout(dpp, 15) << "read_log_and_missing missing " << *i << dendl; missing.add(i->soid, i->version, eversion_t()); } } @@ -1166,12 +1166,12 @@ public: */ assert(oi.version == i->first); } else { - ldpp_dout(dpp, 15) << "read_log missing " << *i << dendl; + ldpp_dout(dpp, 15) << "read_log_and_missing missing " << *i << dendl; missing.add(i->second, i->first, eversion_t()); } } } - ldpp_dout(dpp, 10) << "read_log done" << dendl; + ldpp_dout(dpp, 10) << "read_log_and_missing done" << dendl; } }; diff --git a/src/tools/ceph_objectstore_tool.cc b/src/tools/ceph_objectstore_tool.cc index ab8f22a72d6..26329ee2501 100644 --- a/src/tools/ceph_objectstore_tool.cc +++ b/src/tools/ceph_objectstore_tool.cc @@ -351,7 +351,7 @@ int get_log(ObjectStore *fs, __u8 struct_ver, try { ostringstream oss; assert(struct_ver > 0); - PGLog::read_log(fs, coll, + PGLog::read_log_and_missing(fs, coll, struct_ver >= 8 ? coll : coll_t::meta(), struct_ver >= 8 ? pgid.make_pgmeta_oid() : log_oid, info, divergent_priors, log, missing, oss); @@ -359,7 +359,7 @@ int get_log(ObjectStore *fs, __u8 struct_ver, cerr << oss.str() << std::endl; } catch (const buffer::error &e) { - cerr << "read_log threw exception error " << e.what() << std::endl; + cerr << "read_log_and_missing threw exception error " << e.what() << std::endl; return -EFAULT; } return 0;