Skip to content

Commit

Permalink
ReplicatedBackend: don't queue Context outside of ObjectStore with obc
Browse files Browse the repository at this point in the history
We only flush the ObjectStore callbacks, not everything else.  Thus,
there isn't a guarrantee that the obc held by pull_complete_info will
be cleaned up before the Flush callback is triggered.  Instead, just
defer clearing the pull state until the callback (it'll be cleaned up
during the interval change) and remove the ObjectContext from
pull_complete_info.

Introduced: 68defc2
Fixes: http://tracker.ceph.com/issues/18927
Signed-off-by: Samuel Just <sjust@redhat.com>
  • Loading branch information
athanatos committed Feb 17, 2017
1 parent 91b7423 commit 51eee55
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/osd/ReplicatedBackend.cc
Expand Up @@ -875,7 +875,11 @@ struct C_ReplicatedBackend_OnPullComplete : GenContext<ThreadPool::TPHandle&> {
void finish(ThreadPool::TPHandle &handle) {
ReplicatedBackend::RPGHandle *h = bc->_open_recovery_op();
for (auto &&i: to_continue) {
if (!bc->start_pushes(i.hoid, i.obc, h)) {
auto j = bc->pulling.find(i.hoid);
assert(j != bc->pulling.end());
ObjectContextRef obc = j->second.obc;
bc->clear_pull(j);
if (!bc->start_pushes(i.hoid, obc, h)) {
bc->get_parent()->on_global_recover(
i.hoid, i.stat);
}
Expand Down Expand Up @@ -1865,10 +1869,9 @@ bool ReplicatedBackend::handle_pull_response(

if (complete) {
pi.stat.num_objects_recovered++;
to_continue->push_back({hoid, pi.obc, pi.stat});
to_continue->push_back({hoid, pi.stat});
get_parent()->on_local_recover(
hoid, pi.recovery_info, pi.obc, t);
clear_pull(pulling.find(hoid));
return false;
} else {
response->soid = pop.soid;
Expand Down
1 change: 0 additions & 1 deletion src/osd/ReplicatedBackend.h
Expand Up @@ -245,7 +245,6 @@ class ReplicatedBackend : public PGBackend {

struct pull_complete_info {
hobject_t hoid;
ObjectContextRef obc;
object_stat_sum_t stat;
};
bool handle_pull_response(
Expand Down

0 comments on commit 51eee55

Please sign in to comment.