objecter: fix is_latest_map() retry on mon session restart

If the mon session drops, we get an EAGAIN callback, which we already
correctly ignored.  (Clean this up and comment so it's clearer what is
going on.)

Fix ms_handle_connect() to resubmit those requests.

Noticed while fixing #3049.

Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Sage Weil 2012-08-26 21:21:44 -07:00
parent 7d40cba241
commit e59b9daefc

View File

@ -588,8 +588,10 @@ void Objecter::handle_osd_map(MOSDMap *m)
void Objecter::C_Op_Map_Latest::finish(int r)
{
if (r < 0)
if (r == -EAGAIN) {
// ignore callback; we will retry in resend_mon_ops()
return;
}
Mutex::Locker l(objecter->client_lock);
@ -617,8 +619,10 @@ void Objecter::C_Op_Map_Latest::finish(int r)
void Objecter::C_Linger_Map_Latest::finish(int r)
{
if (r < 0)
if (r == -EAGAIN) {
// ignore callback; we will retry in resend_mon_ops()
return;
}
Mutex::Locker l(objecter->client_lock);
@ -869,6 +873,20 @@ void Objecter::resend_mon_ops()
pool_op_submit(p->second);
logger->inc(l_osdc_poolop_resend);
}
for (map<tid_t, Op*>::iterator p = check_latest_map_ops.begin();
p != check_latest_map_ops.end();
++p) {
monc->is_latest_map("osdmap", osdmap->get_epoch(),
new C_Op_Map_Latest(this, p->second->tid));
}
for (map<uint64_t, LingerOp*>::iterator p = check_latest_map_lingers.begin();
p != check_latest_map_lingers.end();
++p) {
monc->is_latest_map("osdmap", osdmap->get_epoch(),
new C_Linger_Map_Latest(this, p->second->linger_id));
}
}