DEVEL15-windows-volstate-update-post-network-change-20070614

When the system's IP address list changes we invalidate the existing
RX connections and probe all of the servers.  A better algorithm is
to probe all vldb servers, invalidate the rx connections, and then
probe all file servers.


(cherry picked from commit 0187bf2feb)
This commit is contained in:
Jeffrey Altman 2007-06-14 21:55:18 +00:00
parent b8d45dbd09
commit 14115da9fb
3 changed files with 12 additions and 3 deletions

View File

@ -59,10 +59,11 @@ void cm_IpAddrDaemon(long parm)
while (daemon_ShutdownFlag == 0) {
DWORD Result = NotifyAddrChange(NULL,NULL);
if (Result == NO_ERROR && daemon_ShutdownFlag == 0) {
osi_Log0(afsd_logp, "cm_IpAddrDaemon CheckDownServers");
Sleep(2500);
osi_Log0(afsd_logp, "cm_IpAddrDaemon CheckDownServers");
cm_CheckServers(CM_FLAG_CHECKVLDBSERVERS | CM_FLAG_CHECKUPSERVERS | CM_FLAG_CHECKDOWNSERVERS, NULL);
cm_ForceNewConnectionsAllServers();
cm_CheckServers(CM_FLAG_CHECKUPSERVERS | CM_FLAG_CHECKDOWNSERVERS, NULL);
cm_CheckServers(CM_FLAG_CHECKFILESERVERS | CM_FLAG_CHECKUPSERVERS | CM_FLAG_CHECKDOWNSERVERS, NULL);
smb_CheckVCs();
}
}

View File

@ -201,6 +201,7 @@ void cm_CheckServers(long flags, cm_cell_t *cellp)
cm_server_t *tsp;
int doPing;
int isDown;
int isFS;
lock_ObtainWrite(&cm_serverLock);
for (tsp = cm_allServersp; tsp; tsp = tsp->allNextp) {
@ -212,6 +213,7 @@ void cm_CheckServers(long flags, cm_cell_t *cellp)
doPing = 0;
isDown = tsp->flags & CM_SERVERFLAG_DOWN;
isFS = tsp->type == CM_SERVER_FILE;
/* only do the ping if the cell matches the requested cell, or we're
* matching all cells (cellp == NULL), and if we've requested to ping
@ -219,7 +221,11 @@ void cm_CheckServers(long flags, cm_cell_t *cellp)
*/
if ((cellp == NULL || cellp == tsp->cellp) &&
((isDown && (flags & CM_FLAG_CHECKDOWNSERVERS)) ||
(!isDown && (flags & CM_FLAG_CHECKUPSERVERS)))) {
(!isDown && (flags & CM_FLAG_CHECKUPSERVERS))) &&
((!(flags & CM_FLAG_CHECKVLDBSERVERS) ||
!isFS && (flags & CM_FLAG_CHECKVLDBSERVERS)) &&
(!(flags & CM_FLAG_CHECKFILESERVERS) ||
isFS && (flags & CM_FLAG_CHECKFILESERVERS)))) {
doPing = 1;
} /* we're supposed to check this up/down server */
lock_ReleaseMutex(&tsp->mx);

View File

@ -67,6 +67,8 @@ typedef struct cm_serverRef {
/* flags for procedures */
#define CM_FLAG_CHECKUPSERVERS 1 /* check working servers */
#define CM_FLAG_CHECKDOWNSERVERS 2 /* check down servers */
#define CM_FLAG_CHECKVLDBSERVERS 4 /* check only vldb servers */
#define CM_FLAG_CHECKFILESERVERS 8 /* check only file servers */
/* values for ipRank */
#define CM_IPRANK_TOP 5000 /* on same machine */