From e59b9daefcd06ee1fc0543924dcd6e8ff537db3e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sun, 26 Aug 2012 21:21:44 -0700 Subject: [PATCH] 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 --- src/osdc/Objecter.cc | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index 3a42277dbcd..b1c7c98e796 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -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::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::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)); + } }