OpenAFS
OpenAFS distributed network file system
/cygdrive/c/src/openafs/openafs.git/repo/src/ubik/beacon.c File Reference

Module responsible for both deciding if we're currently the sync site, and keeping collecting votes so as to stay sync site. More...

#include <afsconfig.h>
#include <afs/param.h>
#include <roken.h>
#include <afs/opr.h>
#include <lock.h>
#include <rx/rx.h>
#include <rx/rxkad.h>
#include <rx/rx_multi.h>
#include <afs/cellconfig.h>
#include <afs/afsutil.h>
#include "ubik.h"
#include "ubik_int.h"

Functions

void ubeacon_Debug (struct ubik_debug *aparm)
 procedure called from debug rpc call to get this module's state for debugging
int ubeacon_AmSyncSite (void)
 Procedure that determines whether this site has enough current votes to remain sync site.
int ubeacon_InitServerListByInfo (afs_uint32 ame, struct afsconf_cell *info, char clones[])
int ubeacon_InitServerList (afs_uint32 ame, afs_uint32 aservers[])
void ubeacon_InitSecurityClass (void)
void ubeacon_ReinitServer (struct ubik_server *ts)
void * ubeacon_Interact (void *dummy)
 main lwp loop for code that sends out beacons.
int ubeacon_updateUbikNetworkAddress (afs_uint32 ubik_host[UBIK_MAX_INTERFACE_ADDR])
 Exchange IP address information with remote servers.
void ubik_SetClientSecurityProcs (int(*secproc)(void *, struct rx_securityClass **, afs_int32 *), int(*checkproc)(void *), void *rock)

Variables

int(* ubik_CRXSecurityProc )(void *rock, struct rx_securityClass **, afs_int32 *)
void * ubik_CRXSecurityRock
afs_int32 ubikSecIndex
struct rx_securityClassubikSecClass
struct addr_data addr_globals
struct beacon_data beacon_globals
statics used to determine if we're the sync site
char amIClone = 0
 is this a clone which doesn't vote

Detailed Description

Module responsible for both deciding if we're currently the sync site, and keeping collecting votes so as to stay sync site.

The basic module contacts all of the servers it can, trying to get them to vote for this server for sync site. The vote request message (called a beacon message) also specifies until which time this site claims to be the sync site, if at all, thus enabling receiving sites to know how long the sync site guarantee is made for.

Each of these beacon messages is thus both a declaration of how long this site will remain sync site, and an attempt to extend that time by collecting votes for a later sync site extension.

The voting module is responsible for choosing a reasonable time until which it promises not to vote for someone else. This parameter (BIG seconds) is not actually passed in the interface (perhaps it should be?) but is instead a compile time constant that both sides know about.

The beacon and vote modules work intimately together; the vote module decides how long it should promise the beacon module its vote, and the beacon module takes all of these votes and decides for how long it is the synchronization site.


Function Documentation

int ubeacon_AmSyncSite ( void  )

Procedure that determines whether this site has enough current votes to remain sync site.

Called from higher-level modules (everything but the vote module).

If we're the sync site, check that our guarantees, obtained by the ubeacon_Interact() light-weight process, haven't expired. We're sync site as long as a majority of the servers in existence have promised us unexpired guarantees. The variable #ubik_syncSiteUntil contains the time at which the latest of the majority of the sync site guarantees expires (if the variable #ubik_amSyncSite is true) This module also calls up to the recovery module if it thinks that the recovery module may have to pick up a new database (which offucr sif [sic] we lose the sync site votes).

Returns:
1 if local site is the sync site
0 if sync site is elsewhere
int ubeacon_InitServerList ( afs_uint32  ame,
afs_uint32  aservers[] 
)
Parameters:
ame"address of me"
aserverslist of other servers
See also:
ubeacon_InitServerListCommon()
int ubeacon_InitServerListByInfo ( afs_uint32  ame,
struct afsconf_cell info,
char  clones[] 
)
See also:
ubeacon_InitServerListCommon()
void* ubeacon_Interact ( void *  dummy)

main lwp loop for code that sends out beacons.

This code only runs while we're sync site or we want to be the sync site. It runs in its very own light-weight process.

int ubeacon_updateUbikNetworkAddress ( afs_uint32  ubik_host[UBIK_MAX_INTERFACE_ADDR])

Exchange IP address information with remote servers.

Parameters:
ubik_hostan array containing all my IP addresses.

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 ubik_servers

Returns:
0 on success, non-zero on failure
 All Data Structures Files Functions Variables