]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
objecter: fix is_latest_map() retry on mon session restart
authorSage Weil <sage@inktank.com>
Mon, 27 Aug 2012 04:21:44 +0000 (21:21 -0700)
committerSage Weil <sage@inktank.com>
Tue, 28 Aug 2012 00:25:57 +0000 (17:25 -0700)
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>
src/osdc/Objecter.cc

index 3a42277dbcd4996067c9eb50b4d2ccf558dc433a..b1c7c98e796ecd4d7dc0680d6e5be4f015bc52c5 100644 (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));
+  }
 }