Whamcloud - gitweb
LU-630 lnet: only router checks peer health
authorLai Siyao <laisiyao@whamcloud.com>
Mon, 5 Dec 2011 07:28:39 +0000 (15:28 +0800)
committerJohann Lombardi <johann.lombardi@intel.com>
Fri, 19 Oct 2012 12:49:19 +0000 (08:49 -0400)
The peer health code is designed for router, so a ~rtr node always
assumes peers to be alive.

Signed-off-by: Lai Siyao <laisiyao@whamcloud.com>
Change-Id: Iacdc7359c69e0f172de0914048b35bd6fe06133e
Reviewed-on: http://review.whamcloud.com/4287
Tested-by: Hudson
Reviewed-by: Isaac Huang <he.huang@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
lnet/lnet/lib-move.c

index eb4f286..ceb4b7e 100644 (file)
@@ -922,6 +922,7 @@ lnet_ni_peer_alive(lnet_peer_t *lp)
 
         LASSERT (lnet_peer_aliveness_enabled(lp));
         LASSERT (ni->ni_lnd->lnd_query != NULL);
+        LASSERT (the_lnet.ln_routing == 1);
 
         LNET_UNLOCK();
         (ni->ni_lnd->lnd_query)(ni, lp->lp_nid, &last_alive);
@@ -931,7 +932,6 @@ lnet_ni_peer_alive(lnet_peer_t *lp)
 
         if (last_alive != 0) /* NI has updated timestamp */
                 lp->lp_last_alive = last_alive;
-        return;
 }
 
 /* NB: always called with LNET_LOCK held */
@@ -942,6 +942,7 @@ lnet_peer_is_alive (lnet_peer_t *lp, cfs_time_t now)
         cfs_time_t deadline;
 
         LASSERT (lnet_peer_aliveness_enabled(lp));
+        LASSERT (the_lnet.ln_routing == 1);
 
         /* Trust lnet_notify() if it has more recent aliveness news, but
          * ignore the initial assumed death (see lnet_peers_start_down()).
@@ -973,6 +974,10 @@ lnet_peer_alive_locked (lnet_peer_t *lp)
 {
         cfs_time_t now = cfs_time_current();
 
+        /* LU-630: only router checks peer health. */
+        if (the_lnet.ln_routing == 0)
+                return 1;
+
         if (!lnet_peer_aliveness_enabled(lp))
                 return -ENODEV;