Skip to content

Commit

Permalink
Merge pull request #16132 from smithfarm/wip-20522-kraken
Browse files Browse the repository at this point in the history
kraken: FAILED assert(object_contexts.empty()) (live on master only from Jan-Feb 2017, all other instances are different)

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
  • Loading branch information
smithfarm committed Jul 6, 2017
2 parents f45de0f + 4055034 commit 08b8a73
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/osd/PrimaryLogPG.cc
Expand Up @@ -124,17 +124,17 @@ class PrimaryLogPG::CopyCallback : public GenContext<CopyCallbackResults> {
template <typename T>
class PrimaryLogPG::BlessedGenContext : public GenContext<T> {
PrimaryLogPGRef pg;
GenContext<T> *c;
unique_ptr<GenContext<T>> c;
epoch_t e;
public:
BlessedGenContext(PrimaryLogPG *pg, GenContext<T> *c, epoch_t e)
: pg(pg), c(c), e(e) {}
void finish(T t) {
pg->lock();
if (pg->pg_has_reset_since(e))
delete c;
c.reset();
else
c->complete(t);
c.release()->complete(t);
pg->unlock();
}
};
Expand All @@ -147,17 +147,17 @@ GenContext<ThreadPool::TPHandle&> *PrimaryLogPG::bless_gencontext(

class PrimaryLogPG::BlessedContext : public Context {
PrimaryLogPGRef pg;
Context *c;
unique_ptr<Context> c;
epoch_t e;
public:
BlessedContext(PrimaryLogPG *pg, Context *c, epoch_t e)
: pg(pg), c(c), e(e) {}
void finish(int r) {
pg->lock();
if (pg->pg_has_reset_since(e))
delete c;
c.reset();
else
c->complete(r);
c.release()->complete(r);
pg->unlock();
}
};
Expand Down
13 changes: 8 additions & 5 deletions src/osd/ReplicatedBackend.cc
Expand Up @@ -47,13 +47,13 @@ class PG_SendMessageOnConn: public Context {

class PG_RecoveryQueueAsync : public Context {
PGBackend::Listener *pg;
GenContext<ThreadPool::TPHandle&> *c;
unique_ptr<GenContext<ThreadPool::TPHandle&>> c;
public:
PG_RecoveryQueueAsync(
PGBackend::Listener *pg,
GenContext<ThreadPool::TPHandle&> *c) : pg(pg), c(c) {}
void finish(int) {
pg->schedule_recovery_work(c);
pg->schedule_recovery_work(c.release());
}
};
}
Expand Down 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 08b8a73

Please sign in to comment.