Skip to content

Commit

Permalink
Merge pull request ceph#38390 from xxhdx1985126/wip-obc-related-issues
Browse files Browse the repository at this point in the history
crimson/osd: fix several obc related issues

Reviewed-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov authored Dec 2, 2020
2 parents cd1f917 + fa27b6e commit ca42b2b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
6 changes: 2 additions & 4 deletions src/crimson/osd/object_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,8 @@ class ObjectContext : public Blocker,
return false;
}
}
seastar::future<> wait_recovery_read() {
return lock.lock_for_read().then([this] {
recovery_read_marker = true;
});
void wait_recovery_read() {
recovery_read_marker = true;
}
void drop_recovery_read() {
assert(recovery_read_marker);
Expand Down
4 changes: 2 additions & 2 deletions src/crimson/osd/pg.cc
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ PG::with_head_obc(hobject_t oid, with_obc_func_t&& func)
logger().debug("with_head_obc: found {} in cache", oid);
} else {
logger().debug("with_head_obc: cache miss on {}", oid);
loaded = obc->with_promoted_lock<RWState::RWEXCL>([this, obc] {
loaded = obc->with_promoted_lock<State>([this, obc] {
return load_head_obc(obc);
});
}
Expand Down Expand Up @@ -873,7 +873,7 @@ PG::with_clone_obc(hobject_t oid, with_obc_func_t&& func)
logger().debug("with_clone_obc: found {} in cache", coid);
} else {
logger().debug("with_clone_obc: cache miss on {}", coid);
loaded = clone->template with_promoted_lock<RWState::RWEXCL>(
loaded = clone->template with_promoted_lock<State>(
[coid, clone, head, this] {
return backend->load_metadata(coid).safe_then(
[coid, clone=std::move(clone), head=std::move(head)](auto md) mutable {
Expand Down
3 changes: 2 additions & 1 deletion src/crimson/osd/replicated_recovery_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ auto ReplicatedRecoveryBackend::load_obc_for_recovery(
return pg.with_head_obc<RWState::RWREAD>(soid, [&recovery_waiter](auto obc) {
logger().debug("load_obc_for_recovery: loaded obc: {}", obc->obs.oi.soid);
recovery_waiter.obc = obc;
return recovery_waiter.obc->wait_recovery_read();
recovery_waiter.obc->wait_recovery_read();
return seastar::now();
});
}

Expand Down

0 comments on commit ca42b2b

Please sign in to comment.