Whamcloud - gitweb
b=22423 rely on pings to issue reconnects
authorJohann Lombardi <johann@sun.com>
Tue, 6 Apr 2010 08:56:23 +0000 (10:56 +0200)
committerJohann Lombardi <johann@sun.com>
Tue, 6 Apr 2010 08:56:23 +0000 (10:56 +0200)
i=nathan
i=dmitry

Don't wake up pinger on reconnect failures and rely on
regular pings to trigger the next reconnection.
Please note that the pinger already uses a smaller interval
if the import is disconnected.

lustre/ptlrpc/import.c
lustre/ptlrpc/pinger.c
lustre/ptlrpc/ptlrpc_internal.h

index b401dad..efeac7c 100644 (file)
@@ -469,13 +469,6 @@ static int import_select_connection(struct obd_import *imp)
                        libcfs_nid2str(conn->oic_conn->c_peer.nid),
                        conn->oic_last_attempt);
 
-                /* Don't thrash connections */
-                if (cfs_time_before_64(cfs_time_current_64(),
-                                     conn->oic_last_attempt +
-                                     cfs_time_seconds(CONNECTION_SWITCH_MIN))) {
-                        continue;
-                }
-
                 /* If we have not tried this connection since the
                    the last successful attempt, go with this one */
                 if ((conn->oic_last_attempt == 0) ||
@@ -739,42 +732,12 @@ EXPORT_SYMBOL(ptlrpc_connect_import);
 static void ptlrpc_maybe_ping_import_soon(struct obd_import *imp)
 {
 #ifdef __KERNEL__
-        struct obd_import_conn *imp_conn;
-#endif
-        int wake_pinger = 0;
-
-        ENTRY;
-
-        spin_lock(&imp->imp_lock);
-        if (list_empty(&imp->imp_conn_list))
-                GOTO(unlock, 0);
-
-#ifdef __KERNEL__
-        imp_conn = list_entry(imp->imp_conn_list.prev,
-                              struct obd_import_conn,
-                              oic_item);
-
-        /* XXX: When the failover node is the primary node, it is possible
-         * to have two identical connections in imp_conn_list. We must
-         * compare not conn's pointers but NIDs, otherwise we can defeat
-         * connection throttling. (See bug 14774.) */
-        if (imp->imp_conn_current->oic_conn->c_peer.nid !=
-                                imp_conn->oic_conn->c_peer.nid) {
-                ptlrpc_ping_import_soon(imp);
-                wake_pinger = 1;
-        }
-
+        /* the pinger takes care of issuing the next reconnect request */
+        return;
 #else
         /* liblustre has no pinger thead, so we wakup pinger anyway */
-        wake_pinger = 1;
+        ptlrpc_pinger_wake_up();
 #endif
- unlock:
-        spin_unlock(&imp->imp_lock);
-
-        if (wake_pinger)
-                ptlrpc_pinger_wake_up();
-
-        EXIT;
 }
 
 static int ptlrpc_busy_reconnect(int rc)
index 547c2f6..c22e38e 100644 (file)
@@ -178,11 +178,6 @@ static void ptlrpc_update_next_ping(struct obd_import *imp, int soon)
 #endif /* ENABLE_PINGER */
 }
 
-void ptlrpc_ping_import_soon(struct obd_import *imp)
-{
-        imp->imp_next_ping = cfs_time_current();
-}
-
 static inline int imp_is_deactive(struct obd_import *imp)
 {
         return (imp->imp_deactive ||
index 7813a40..67d7672 100644 (file)
@@ -96,7 +96,6 @@ int ptlrpc_stop_pinger(void);
 void ptlrpc_pinger_sending_on_import(struct obd_import *imp);
 void ptlrpc_pinger_commit_expected(struct obd_import *imp);
 void ptlrpc_pinger_wake_up(void);
-void ptlrpc_ping_import_soon(struct obd_import *imp);
 
 /* recov_thread.c */
 int llog_recov_init(void);