Skip to content

Commit

Permalink
crimson/osd: add_recovery(oid) before recover_object(oid)
Browse files Browse the repository at this point in the history
in 7736bdd, we assumed that the object
to be recovered did not exist in `recovering` before
`recover_object(oid)` was called. but this turns out not true. so, in
this change, `add_object(oid)` is called before `recover_object(oid)`
gets called.

Fixes: https://tracker.ceph.com/issues/47593
Signed-off-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov committed Sep 23, 2020
1 parent 6cbc51d commit 35d37e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/crimson/osd/pg_recovery.cc
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ void PGRecovery::enqueue_push(
{
logger().debug("{}: target={} obj={} v={}",
__func__, target, obj, v);
pg->get_recovery_backend()->add_recovering(obj);
std::ignore = pg->get_recovery_backend()->recover_object(obj, v).\
handle_exception([] (auto) {
ceph_abort_msg("got exception on backfill's push");
Expand Down
5 changes: 2 additions & 3 deletions src/crimson/osd/replicated_recovery_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ seastar::future<> ReplicatedRecoveryBackend::recover_object(
eversion_t need)
{
logger().debug("{}: {}, {}", __func__, soid, need);
[[maybe_unused]] auto [r, added] =
recovering.emplace(soid, WaitForObjectRecovery{});
// always add_recovering(soid) before recover_object(soid)
assert(is_recovering(soid));
// start tracking the recovery of soid
assert(added);
return seastar::do_with(std::map<pg_shard_t, PushOp>(), get_shards_to_push(soid),
[this, soid, need](auto& pops, auto& shards) {
return maybe_pull_missing_obj(soid, need).then([this, soid](bool pulled) {
Expand Down

0 comments on commit 35d37e2

Please sign in to comment.