Skip to content

Commit

Permalink
osd/PGLog: drop old compat coll/oid args to read_log_and_missing
Browse files Browse the repository at this point in the history
The oldest version we care about is 10, and these were for <8.

Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas committed Oct 6, 2017
1 parent 2347ecb commit 582ee8d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 23 deletions.
3 changes: 1 addition & 2 deletions src/osd/PG.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
15 changes: 7 additions & 8 deletions src/osd/PGLog.h
Original file line number Diff line number Diff line change
Expand Up @@ -1257,15 +1257,14 @@ struct PGLog : DoutPrefixProvider {
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,
Expand All @@ -1278,8 +1277,7 @@ struct PGLog : DoutPrefixProvider {
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,
Expand All @@ -1291,18 +1289,19 @@ struct PGLog : DoutPrefixProvider {
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<eversion_t, hobject_t> divergent_priors;
bool must_rebuild = false;
missing.may_include_deletes = false;
Expand Down
2 changes: 1 addition & 1 deletion src/test/osd/TestPGLog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2495,7 +2495,7 @@ class PGLogMergeDupsTest : protected PGLog, public StoreTestFixture {
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);
Expand Down
18 changes: 6 additions & 12 deletions src/tools/ceph_objectstore_tool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 582ee8d

Please sign in to comment.