]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
objecter: reconnect on osd disconnect
authorSage Weil <sage@newdream.net>
Thu, 21 Oct 2010 18:37:45 +0000 (11:37 -0700)
committerSage Weil <sage@newdream.net>
Thu, 21 Oct 2010 18:37:45 +0000 (11:37 -0700)
If the connection closes to an OSD, we need to reconnect and resubmit our
ops.  Otherwise we just hang.  This is problematic if it is a transient
error, since we'll only retry if the OSDMap reflects a change, and that
won't happen for transient network/socket errors and such.

Signed-off-by: Sage Weil <sage@newdream.net>
src/osdc/Objecter.cc

index 215213bf6913aa0566eed1de9e4814efeecab069..69d8222b9c169d6c8aa2f7a93d636724230b3d88 100644 (file)
@@ -1110,8 +1110,19 @@ void Objecter::ms_handle_connect(Connection *con)
 
 void Objecter::ms_handle_reset(Connection *con)
 {
-  if (con->get_peer_type() == CEPH_ENTITY_TYPE_OSD)
-    maybe_request_map();
+  if (con->get_peer_type() == CEPH_ENTITY_TYPE_OSD) {
+    //
+    int osd = osdmap->identify_osd(con->get_peer_addr());
+    if (osd >= 0) {
+      dout(1) << "ms_handle_reset on osd" << osd << dendl;
+      set<pg_t> changed_pgs;
+      scan_pgs_for(changed_pgs, osd);
+      kick_requests(changed_pgs);
+      maybe_request_map();
+    } else {
+      dout(10) << "ms_handle_reset on unknown osd addr " << con->get_peer_addr() << dendl;
+    }
+  }
 }
 
 void Objecter::ms_handle_remote_reset(Connection *con)