Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mark_unfound_lost fix and some other minor changes #18449

Merged
merged 6 commits into from Oct 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 0 additions & 3 deletions qa/standalone/special/ceph_objectstore_tool.py
Expand Up @@ -992,9 +992,6 @@ def main(argv):
cmd = "{path}/ceph-objectstore-tool --data-path BAD_DATA_PATH --op list".format(osd=ONEOSD, path=CEPH_BIN)
ERRORS += test_failure(cmd, "data-path: BAD_DATA_PATH: No such file or directory")

cmd = "{path}/ceph-objectstore-tool --journal-path BAD_JOURNAL_PATH --op dump-journal".format(path=CEPH_BIN)
ERRORS += test_failure(cmd, "journal-path: BAD_JOURNAL_PATH: (2) No such file or directory")

cmd = (CFSD_PREFIX + "--journal-path BAD_JOURNAL_PATH --op list").format(osd=ONEOSD)
ERRORS += test_failure(cmd, "journal-path: BAD_JOURNAL_PATH: No such file or directory")

Expand Down
5 changes: 3 additions & 2 deletions src/osd/PGBackend.cc
Expand Up @@ -768,7 +768,7 @@ map<pg_shard_t, ScrubMap *>::const_iterator
eversion_t auth_version;
bufferlist first_bl;

// Create list of shards with primary last so it will be auth copy all
// Create list of shards with primary first so it will be auth copy all
// other things being equal.
list<pg_shard_t> shards;
for (map<pg_shard_t, ScrubMap *>::const_iterator j = maps.begin();
Expand All @@ -778,7 +778,7 @@ map<pg_shard_t, ScrubMap *>::const_iterator
continue;
shards.push_back(j->first);
}
shards.push_back(get_parent()->whoami_shard());
shards.push_front(get_parent()->whoami_shard());

map<pg_shard_t, ScrubMap *>::const_iterator auth = maps.end();
for (auto &l : shards) {
Expand Down Expand Up @@ -990,6 +990,7 @@ void PGBackend::be_compare_scrubmaps(
// Track possible shard to use as authoritative, if needed
// There are errors, without identifying the shard
object_errors.insert(j->first);
errorstream << pgid << " : soid " << *k << " " << ss.str() << "\n";
} else {
// XXX: The auth shard might get here that we don't know
// that it has the "correct" data.
Expand Down
11 changes: 7 additions & 4 deletions src/osd/PrimaryLogPG.cc
Expand Up @@ -10550,6 +10550,13 @@ void PrimaryLogPG::mark_all_unfound_lost(
log_entries.push_back(e);
oids.push_back(oid);

// If context found mark object as deleted in case
// of racing with new creation. This can happen if
// object lost and EIO at primary.
obc = object_contexts.lookup(oid);
if (obc)
obc->obs.exists = false;

++v.version;
++m;
}
Expand All @@ -10576,10 +10583,6 @@ void PrimaryLogPG::mark_all_unfound_lost(
}
}

for (auto& p : waiting_for_unreadable_object) {
release_backoffs(p.first);
}
requeue_object_waiters(waiting_for_unreadable_object);
if (is_recovery_unfound()) {
queue_peering_event(
CephPeeringEvtRef(
Expand Down
4 changes: 2 additions & 2 deletions src/tools/ceph_objectstore_tool.cc
Expand Up @@ -1116,8 +1116,8 @@ int get_pg_metadata(ObjectStore *store, bufferlist &bl, metadata_section &ms,

if (debug) {
cerr << "Import pgid " << ms.info.pgid << std::endl;
cerr << "Clearing past_intervals " << ms.past_intervals << std::endl;
cerr << "Zero same_interval_since " << ms.info.history.same_interval_since << std::endl;
cerr << "Previous past_intervals " << ms.past_intervals << std::endl;
cerr << "history.same_interval_since " << ms.info.history.same_interval_since << std::endl;
}

if (debug)
Expand Down
5 changes: 4 additions & 1 deletion src/tools/ceph_osdomap_tool.cc
Expand Up @@ -37,7 +37,7 @@ int main(int argc, char **argv) {
("debug", "Additional debug output from DBObjectMap")
("oid", po::value<string>(&oid), "Restrict to this object id when dumping objects")
("command", po::value<string>(&cmd),
"command arg is one of [dump-raw-keys, dump-raw-key-vals, dump-objects, dump-objects-with-keys, check, dump-headers, repair], mandatory")
"command arg is one of [dump-raw-keys, dump-raw-key-vals, dump-objects, dump-objects-with-keys, check, dump-headers, repair, compact], mandatory")
("backend", po::value<string>(&backend),
"DB backend (default rocksdb)")
;
Expand Down Expand Up @@ -203,6 +203,9 @@ int main(int argc, char **argv) {
omap.state.v = 2;
omap.state.legacy = false;
omap.set_state();
} else if (cmd == "compact") {
omap.compact();
return 0;
} else {
std::cerr << "Did not recognize command " << cmd << std::endl;
return 1;
Expand Down