From 582ee8d4b7112dcd8e1168c54ce6d615d00b0171 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 6 Oct 2017 14:34:41 -0500 Subject: [PATCH] osd/PGLog: drop old compat coll/oid args to read_log_and_missing The oldest version we care about is 10, and these were for <8. Signed-off-by: Sage Weil --- src/osd/PG.cc | 3 +-- src/osd/PGLog.h | 15 +++++++-------- src/test/osd/TestPGLog.cc | 2 +- src/tools/ceph_objectstore_tool.cc | 18 ++++++------------ 4 files changed, 15 insertions(+), 23 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 47817f0bb919a..d08b46e898e3d 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -3290,8 +3290,7 @@ void PG::read_state(ObjectStore *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), + pgmeta_oid, info, oss, cct->_conf->osd_ignore_stale_divergent_priors, diff --git a/src/osd/PGLog.h b/src/osd/PGLog.h index db3aa10541066..4e8e084a2ad31 100644 --- a/src/osd/PGLog.h +++ b/src/osd/PGLog.h @@ -1257,15 +1257,14 @@ public: void read_log_and_missing( ObjectStore *store, coll_t pg_coll, - coll_t log_coll, - ghobject_t log_oid, + ghobject_t pgmeta_oid, const pg_info_t &info, ostringstream &oss, bool tolerate_divergent_missing_log, bool debug_verify_stored_missing = false ) { return read_log_and_missing( - store, pg_coll, log_coll, log_oid, info, + store, pg_coll, pgmeta_oid, info, log, missing, oss, tolerate_divergent_missing_log, &clear_divergent_priors, @@ -1278,8 +1277,7 @@ public: static void read_log_and_missing( ObjectStore *store, coll_t pg_coll, - coll_t log_coll, - ghobject_t log_oid, + ghobject_t pgmeta_oid, const pg_info_t &info, IndexedLog &log, missing_type &missing, @@ -1291,18 +1289,19 @@ public: bool debug_verify_stored_missing = false ) { ldpp_dout(dpp, 20) << "read_log_and_missing coll " << pg_coll - << " log_oid " << log_oid << dendl; + << " " << pgmeta_oid << dendl; // legacy? struct stat st; - int r = store->stat(log_coll, log_oid, &st); + int r = store->stat(pg_coll, pgmeta_oid, &st); assert(r == 0); assert(st.st_size == 0); // will get overridden below if it had been recorded eversion_t on_disk_can_rollback_to = info.last_update; eversion_t on_disk_rollback_info_trimmed_to = eversion_t(); - ObjectMap::ObjectMapIterator p = store->get_omap_iterator(log_coll, log_oid); + ObjectMap::ObjectMapIterator p = store->get_omap_iterator(pg_coll, + pgmeta_oid); map divergent_priors; bool must_rebuild = false; missing.may_include_deletes = false; diff --git a/src/test/osd/TestPGLog.cc b/src/test/osd/TestPGLog.cc index 14ab46601bbd1..4d7a858a520f9 100644 --- a/src/test/osd/TestPGLog.cc +++ b/src/test/osd/TestPGLog.cc @@ -2495,7 +2495,7 @@ public: auto orig_dups = log.dups; clear(); ostringstream err; - read_log_and_missing(store.get(), test_coll, test_coll, log_oid, + read_log_and_missing(store.get(), test_coll, log_oid, pg_info_t(), err, false); ASSERT_EQ(orig_dups.size(), log.dups.size()); ASSERT_EQ(orig_dups, log.dups); diff --git a/src/tools/ceph_objectstore_tool.cc b/src/tools/ceph_objectstore_tool.cc index 2e4884910c731..253882f47bb40 100644 --- a/src/tools/ceph_objectstore_tool.cc +++ b/src/tools/ceph_objectstore_tool.cc @@ -289,9 +289,6 @@ struct lookup_ghobject : public action_on_object_t { } }; -ghobject_t infos_oid = OSD::make_infos_oid(); -ghobject_t log_oid; - int file_fd = fd_none; bool debug; bool force = false; @@ -325,12 +322,12 @@ int get_log(ObjectStore *fs, __u8 struct_ver, try { ostringstream oss; assert(struct_ver > 0); - PGLog::read_log_and_missing(fs, coll, - struct_ver >= 8 ? coll : coll_t::meta(), - struct_ver >= 8 ? pgid.make_pgmeta_oid() : log_oid, - info, log, missing, - oss, - g_ceph_context->_conf->osd_ignore_stale_divergent_priors); + PGLog::read_log_and_missing( + fs, coll, + pgid.make_pgmeta_oid(), + info, log, missing, + oss, + g_ceph_context->_conf->osd_ignore_stale_divergent_priors); if (debug && oss.str().size()) cerr << oss.str() << std::endl; } @@ -1362,7 +1359,6 @@ int ObjectStoreTool::do_import(ObjectStore *store, OSDSuperblock& sb, } ghobject_t pgmeta_oid = pgid.make_pgmeta_oid(); - log_oid = OSD::make_pg_log_oid(pgid); //Check for PG already present. coll_t coll(pgid); @@ -3201,8 +3197,6 @@ int main(int argc, char **argv) goto out; } - log_oid = OSD::make_pg_log_oid(pgid); - if (op == "remove") { if (!force && !dry_run) { cerr << "Please use export-remove or you must use --force option" << std::endl; -- 2.39.5