diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index 7320a1022c6c2..c2e846b39d08b 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -190,10 +190,17 @@ void Objecter::handle_osd_map(MOSDMap *m) if (osdmap->test_flag(CEPH_OSDMAP_FULL) & CEPH_OSDMAP_FULL) maybe_request_map(); - map >::iterator p = waiting_for_map.begin(); + //finish any Contexts that were waiting on a map update + map > >::iterator p = + waiting_for_map.begin(); while (p != waiting_for_map.end() && p->first <= osdmap->get_epoch()) { - finish_contexts(p->second); + //go through the list and call the onfinish methods + for (list >::iterator i = p->second.begin(); + i != p->second.end(); ++i) { + i->first->finish(i->second); + delete i->first; + } waiting_for_map.erase(p++); } @@ -731,7 +738,7 @@ void Objecter::handle_pool_op_reply(MPoolOpReply *m) { last_seen_version = m->version; if (osdmap->get_epoch() < m->epoch) { dout(20) << "waiting for client to reach epoch " << m->epoch << " before calling back" << dendl; - wait_for_new_map(op->onfinish, m->epoch); + wait_for_new_map(op->onfinish, m->epoch, m->replyCode); } else { op->onfinish->finish(m->replyCode); diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index b13e26026fff8..665b43020dbb1 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -366,7 +366,7 @@ class Objecter { map op_statfs; map op_pool; - map > waiting_for_map; + map > > waiting_for_map; /** * track pending ops by pg @@ -442,9 +442,9 @@ class Objecter { int get_client_incarnation() const { return client_inc; } void set_client_incarnation(int inc) { client_inc = inc; } - void wait_for_new_map(Context *c, epoch_t epoch) { + void wait_for_new_map(Context *c, epoch_t epoch, int replyCode=0) { maybe_request_map(); - waiting_for_map[epoch].push_back(c); + waiting_for_map[epoch].push_back(pair(c, replyCode)); } // mid-level helpers