ubik: Defer updateUbikNetworkAddress until after RX startup
authorMarc Dionne <marc.c.dionne@gmail.com>
Sat, 23 Apr 2011 01:24:34 +0000 (21:24 -0400)
committerDerrick Brashear <shadow@dementia.org>
Wed, 27 Apr 2011 00:36:47 +0000 (17:36 -0700)
The beacon package initialization has been moved to precede starting
RX services, but the broadcast of addresses to other servers should
be deferred until after RX is started.

Make updateUbikNetworkAddress an exported function and call it
from the general initilization sequence.

Change-Id: I903398ed275f460cc8373340eed9dac6a560e1da
Reviewed-on: http://gerrit.openafs.org/4525
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

src/ubik/beacon.c
src/ubik/ubik.c
src/ubik/ubik.p.h

index 2acc612..eb2d526 100644 (file)
@@ -62,8 +62,6 @@ static int ubeacon_InitServerListCommon(afs_uint32 ame,
                                        afs_uint32 aservers[]);
 static int verifyInterfaceAddress(afs_uint32 *ame, struct afsconf_cell *info,
                                  afs_uint32 aservers[]);
-static int updateUbikNetworkAddress(afs_uint32 ubik_host[UBIK_MAX_INTERFACE_ADDR]);
-
 
 /*! \file
  * Module responsible for both deciding if we're currently the sync site,
@@ -358,10 +356,6 @@ ubeacon_InitServerListCommon(afs_uint32 ame, struct afsconf_cell *info,
        nServers = i + 1;       /* count this server as well as the remotes */
 
     ubik_quorum = (nServers >> 1) + 1; /* compute the majority figure */
-    /* send addrs to all other servers */
-    code = updateUbikNetworkAddress(ubik_host);
-    if (code)
-       return code;
 
 /* Shoud we set some defaults for RX??
     r_retryInterval = 2;
@@ -737,14 +731,14 @@ verifyInterfaceAddress(afs_uint32 *ame, struct afsconf_cell *info,
  *
  * \param ubik_host an array containing all my IP addresses.
  *
- * Algorithm     : Do an RPC to all remote ubik servers infroming them
+ * Algorithm     : Do an RPC to all remote ubik servers informing them
  *                 about my IP addresses. Get their IP addresses and
  *                 update my linked list of ubik servers \p ubik_servers
  *
  * \return 0 on success, non-zero on failure
  */
-static int
-updateUbikNetworkAddress(afs_uint32 ubik_host[UBIK_MAX_INTERFACE_ADDR])
+int
+ubeacon_updateUbikNetworkAddress(afs_uint32 ubik_host[UBIK_MAX_INTERFACE_ADDR])
 {
     int j, count, code = 0;
     UbikInterfaceAddr inAddr, outAddr;
index ae8c350..14992da 100644 (file)
@@ -513,6 +513,11 @@ ubik_ServerInitCommon(afs_uint32 myHost, short myPort,
               NULL, "rx_ServerProc", &junk);
 #endif
 
+    /* send addrs to all other servers */
+    code = ubeacon_updateUbikNetworkAddress(ubik_host);
+    if (code)
+       return code;
+
     /* now start up async processes */
 #ifdef AFS_PTHREAD_ENV
     ubik_thread_create(&ubeacon_Interact_tattr, &ubeacon_InteractThread,
index 1d0834f..3c53d5a 100644 (file)
@@ -518,6 +518,7 @@ extern int ubeacon_InitServerListByInfo(afs_uint32 ame,
                                        char clones[]);
 extern int ubeacon_InitServerList(afs_uint32 ame, afs_uint32 aservers[]);
 extern void *ubeacon_Interact(void *);
+extern int ubeacon_updateUbikNetworkAddress(afs_uint32 ubik_host[]);
 extern struct beacon_data beacon_globals;
 extern struct addr_data addr_globals;