]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
windows-no-freelance-vldb-failover-20060622
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 22 Jun 2006 22:48:32 +0000 (22:48 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 22 Jun 2006 22:48:32 +0000 (22:48 +0000)
When Freelance mode is not in use the cache manager must load the root.afs
volume of the default cell in order to be able to start.   Unfortunately,
if the first vlserver fails the request to obtain the volume information
will timeout and no retries will be performed.  This patch performs up
to 10 retries in the initialization code in order to enable the vlservers
to be marked down so that failover can occur.

src/WINNT/afsd/afsd_init.c

index 1da704a08513c3b6a65e7b3b410790bd48e08ff0..f820c6ddb8f4cada06fa55592796ffaf815e2d0f 100644 (file)
@@ -1254,11 +1254,15 @@ int afsd_InitDaemons(char **reasonP)
     /* this should really be in an init daemon from here on down */
 
     if (!cm_freelanceEnabled) {
+       int attempts = 10;
+
         osi_Log0(afsd_logp, "Loading Root Volume from cell");
-        code = cm_GetVolumeByName(cm_data.rootCellp, cm_rootVolumeName, cm_rootUserp,
-                                  &req, CM_FLAG_CREATE, &cm_data.rootVolumep);
-        afsi_log("cm_GetVolumeByName code %x root vol %x", code,
-                 (code ? (cm_volume_t *)-1 : cm_data.rootVolumep));
+       do {
+           code = cm_GetVolumeByName(cm_data.rootCellp, cm_rootVolumeName, cm_rootUserp,
+                                      &req, CM_FLAG_CREATE, &cm_data.rootVolumep);
+           afsi_log("cm_GetVolumeByName code %x root vol %x", code,
+                     (code ? (cm_volume_t *)-1 : cm_data.rootVolumep));
+       } while (code && --attempts);
         if (code != 0) {
             *reasonP = "can't find root volume in root cell";
             return -1;