]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commitdiff
ceph: connect to export targets if mds is laggy
authorSage Weil <sage@newdream.net>
Mon, 21 Jun 2010 20:38:35 +0000 (13:38 -0700)
committerSage Weil <sage@newdream.net>
Mon, 21 Jun 2010 21:10:20 +0000 (14:10 -0700)
If an MDS we are talking to may have failed, we need to open sessions to
its potential export targets to ensure that any in-progress migration that
may have involved some of our caps is properly handled.

Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/mds_client.c

index 21c344ba2449cdb636fbab70c2c1fbe1502fdc15..29faa3b6f1af07a1157e0f699196c4f81bd5d727 100644 (file)
@@ -2445,6 +2445,21 @@ static void check_new_map(struct ceph_mds_client *mdsc,
                        wake_up_session_caps(s, 1);
                }
        }
+
+       for (i = 0; i < newmap->m_max_mds && i < mdsc->max_sessions; i++) {
+               s = mdsc->sessions[i];
+               if (!s)
+                       continue;
+               if (!ceph_mdsmap_is_laggy(newmap, i))
+                       continue;
+               if (s->s_state == CEPH_MDS_SESSION_OPEN ||
+                   s->s_state == CEPH_MDS_SESSION_HUNG ||
+                   s->s_state == CEPH_MDS_SESSION_CLOSING) {
+                       dout(" connecting to export targets of laggy mds%d\n",
+                            i);
+                       __open_export_target_sessions(mdsc, s);
+               }
+       }
 }