2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #include <afsconfig.h>
11 #include <afs/param.h>
16 #include <sys/types.h>
28 #include <netinet/in.h>
35 #include <afs/afsutil.h>
37 #define UBIK_INTERNALS
42 * This module is responsible for determining when the system has
43 * recovered to the point that it can handle new transactions. It
44 * replays logs, polls to determine the current dbase after a crash,
45 * and distributes the new database to the others.
47 * The sync site associates a version number with each database. It
48 * broadcasts the version associated with its current dbase in every
49 * one of its beacon messages. When the sync site send a dbase to a
50 * server, it also sends the db's version. A non-sync site server can
51 * tell if it has the right dbase version by simply comparing the
52 * version from the beacon message \p uvote_dbVersion with the version
53 * associated with the database \p ubik_dbase->version. The sync site
54 * itself simply has one counter to keep track of all of this (again
55 * \p ubik_dbase->version).
57 * sync site: routine called when the sync site loses its quorum; this
58 * procedure is called "up" from the beacon package. It resyncs the
59 * dbase and nudges the recovery daemon to try to propagate out the
60 * changes. It also resets the recovery daemon's state, since
61 * recovery must potentially find a new dbase to propagate out. This
62 * routine should not do anything with variables used by non-sync site
67 * if this flag is set, then ubik will use only the primary address
68 * (the address specified in the CellServDB) to contact other
69 * ubik servers. Ubik recovery will not try opening connections
70 * to the alternate interface addresses.
72 int ubikPrimaryAddrOnly;
75 urecovery_ResetState(void)
78 #if !defined(AFS_PTHREAD_ENV)
79 /* No corresponding LWP_WaitProcess found anywhere for this -- klm */
80 LWP_NoYieldSignal(&urecovery_state);
88 * routine called when a non-sync site server goes down; restarts recovery
89 * process to send missing server the new db when it comes back up.
91 * \note This routine should not do anything with variables used by non-sync site servers.
94 urecovery_LostServer(void)
96 #if !defined(AFS_PTHREAD_ENV)
97 /* No corresponding LWP_WaitProcess found anywhere for this -- klm */
98 LWP_NoYieldSignal(&urecovery_state);
104 * return true iff we have a current database (called by both sync
105 * sites and non-sync sites) How do we determine this? If we're the
106 * sync site, we wait until recovery has finished fetching and
107 * re-labelling its dbase (it may still be trying to propagate it out
108 * to everyone else; that's THEIR problem). If we're not the sync
109 * site, then we must have a dbase labelled with the right version,
110 * and we must have a currently-good sync site.
113 urecovery_AllBetter(register struct ubik_dbase *adbase, int areadAny)
115 register afs_int32 rcode;
117 ubik_dprint("allbetter checking\n");
122 if (ubik_dbase->version.epoch > 1)
123 rcode = 1; /* Happy with any good version of database */
126 /* Check if we're sync site and we've got the right data */
127 else if (ubeacon_AmSyncSite() && (urecovery_state & UBIK_RECHAVEDB)) {
131 /* next, check if we're aux site, and we've ever been sent the
132 * right data (note that if a dbase update fails, we won't think
133 * that the sync site is still the sync site, 'cause it won't talk
134 * to us until a timeout period has gone by. When we recover, we
135 * leave this clear until we get a new dbase */
136 else if ((uvote_GetSyncSite() && (vcmp(ubik_dbVersion, ubik_dbase->version) == 0))) { /* && order is important */
140 ubik_dprint("allbetter: returning %d\n", rcode);
145 * \brief abort all transactions on this database
148 urecovery_AbortAll(struct ubik_dbase *adbase)
150 register struct ubik_trans *tt;
151 for (tt = adbase->activeTrans; tt; tt = tt->next) {
158 * \brief this routine aborts the current remote transaction, if any, if the tid is wrong
161 urecovery_CheckTid(register struct ubik_tid *atid)
163 if (ubik_currentTrans) {
164 /* there is remote write trans, see if we match, see if this
165 * is a new transaction */
166 if (atid->epoch != ubik_currentTrans->tid.epoch
167 || atid->counter > ubik_currentTrans->tid.counter) {
168 /* don't match, abort it */
169 /* If the thread is not waiting for lock - ok to end it */
170 #if !defined(UBIK_PAUSE)
171 if (ubik_currentTrans->locktype != LOCKWAIT) {
172 #endif /* UBIK_PAUSE */
173 udisk_end(ubik_currentTrans);
174 #if !defined(UBIK_PAUSE)
176 #endif /* UBIK_PAUSE */
177 ubik_currentTrans = (struct ubik_trans *)0;
186 * log format is defined here, and implicitly in disk.c
188 * 4 byte opcode, followed by parameters, each 4 bytes long. All integers
189 * are in logged in network standard byte order, in case we want to move logs
190 * from machine-to-machine someday.
192 * Begin transaction: opcode \n
193 * Commit transaction: opcode, version (8 bytes) \n
194 * Truncate file: opcode, file number, length \n
195 * Abort transaction: opcode \n
196 * Write data: opcode, file, position, length, <length> data bytes \n
198 * A very simple routine, it just replays the log. Note that this is a new-value only log, which
199 * implies that no uncommitted data is written to the dbase: one writes data to the log, including
200 * the commit record, then we allow data to be written through to the dbase. In our particular
201 * implementation, once a transaction is done, we write out the pages to the database, so that
202 * our buffer package doesn't have to know about stable and uncommitted data in the memory buffers:
203 * any changed data while there is an uncommitted write transaction can be zapped during an
204 * abort and the remaining dbase on the disk is exactly the right dbase, without having to read
208 ReplayLog(register struct ubik_dbase *adbase)
211 register afs_int32 code, tpos;
213 afs_int32 len, thisSize, tfile, filePos;
215 afs_int32 syncFile = -1;
216 afs_int32 data[1024];
218 /* read the lock twice, once to see whether we have a transaction to deal
219 * with that committed, (theoretically, we should support more than one
220 * trans in the log at once, but not yet), and once replaying the
224 /* for now, assume that all ops in log pertain to one transaction; see if there's a commit */
227 (*adbase->read) (adbase, LOGFILE, (char *)&opcode, tpos,
229 if (code != sizeof(afs_int32))
231 if (opcode == LOGNEW) {
232 /* handle begin trans */
233 tpos += sizeof(afs_int32);
234 } else if (opcode == LOGABORT)
236 else if (opcode == LOGEND) {
239 } else if (opcode == LOGTRUNCATE) {
242 (*adbase->read) (adbase, LOGFILE, (char *)buffer, tpos,
243 2 * sizeof(afs_int32));
244 if (code != 2 * sizeof(afs_int32))
245 break; /* premature eof or io error */
246 tpos += 2 * sizeof(afs_int32);
247 } else if (opcode == LOGDATA) {
250 (*adbase->read) (adbase, LOGFILE, (char *)buffer, tpos,
251 3 * sizeof(afs_int32));
252 if (code != 3 * sizeof(afs_int32))
254 /* otherwise, skip over the data bytes, too */
255 tpos += buffer[2] + 3 * sizeof(afs_int32);
257 ubik_dprint("corrupt log opcode (%d) at position %d\n", opcode,
259 break; /* corrupt log! */
263 /* actually do the replay; log should go all the way through the commit record, since
264 * we just read it above. */
270 (*adbase->read) (adbase, LOGFILE, (char *)&opcode, tpos,
272 if (code != sizeof(afs_int32))
274 if (opcode == LOGNEW) {
275 /* handle begin trans */
276 tpos += sizeof(afs_int32);
277 } else if (opcode == LOGABORT)
278 panic("log abort\n");
279 else if (opcode == LOGEND) {
282 (*adbase->read) (adbase, LOGFILE, (char *)buffer, tpos,
283 2 * sizeof(afs_int32));
284 if (code != 2 * sizeof(afs_int32))
286 code = (*adbase->setlabel) (adbase, 0, (ubik_version *)buffer);
290 break; /* all done now */
291 } else if (opcode == LOGTRUNCATE) {
294 (*adbase->read) (adbase, LOGFILE, (char *)buffer, tpos,
295 2 * sizeof(afs_int32));
296 if (code != 2 * sizeof(afs_int32))
297 break; /* premature eof or io error */
298 tpos += 2 * sizeof(afs_int32);
300 (*adbase->truncate) (adbase, ntohl(buffer[0]),
304 } else if (opcode == LOGDATA) {
307 (*adbase->read) (adbase, LOGFILE, (char *)buffer, tpos,
308 3 * sizeof(afs_int32));
309 if (code != 3 * sizeof(afs_int32))
311 tpos += 3 * sizeof(afs_int32);
312 /* otherwise, skip over the data bytes, too */
313 len = ntohl(buffer[2]); /* total number of bytes to copy */
314 filePos = ntohl(buffer[1]);
315 tfile = ntohl(buffer[0]);
316 /* try to minimize file syncs */
317 if (syncFile != tfile) {
319 code = (*adbase->sync) (adbase, syncFile);
327 thisSize = (len > sizeof(data) ? sizeof(data) : len);
328 /* copy sizeof(data) buffer bytes at a time */
330 (*adbase->read) (adbase, LOGFILE, (char *)data, tpos,
332 if (code != thisSize)
335 (*adbase->write) (adbase, tfile, (char *)data, filePos,
337 if (code != thisSize)
344 ubik_dprint("corrupt log opcode (%d) at position %d\n",
346 break; /* corrupt log! */
351 code = (*adbase->sync) (adbase, syncFile);
355 ubik_dprint("Log read error on pass 2\n");
360 /* now truncate the log, we're done with it */
361 code = (*adbase->truncate) (adbase, LOGFILE, 0);
366 * Called at initialization to figure out version of the dbase we really have.
368 * This routine is called after replaying the log; it reads the restored labels.
371 InitializeDB(register struct ubik_dbase *adbase)
373 register afs_int32 code;
375 code = (*adbase->getlabel) (adbase, 0, &adbase->version);
377 /* try setting the label to a new value */
378 adbase->version.epoch = 1; /* value for newly-initialized db */
379 adbase->version.counter = 1;
380 code = (*adbase->setlabel) (adbase, 0, &adbase->version);
382 /* failed, try to set it back */
383 adbase->version.epoch = 0;
384 adbase->version.counter = 0;
385 (*adbase->setlabel) (adbase, 0, &adbase->version);
387 #ifdef AFS_PTHREAD_ENV
388 assert(pthread_cond_broadcast(&adbase->version_cond) == 0);
390 LWP_NoYieldSignal(&adbase->version);
397 * \brief initialize the local ubik_dbase
399 * We replay the logs and then read the resulting file to figure out what version we've really got.
402 urecovery_Initialize(register struct ubik_dbase *adbase)
404 register afs_int32 code;
406 code = ReplayLog(adbase);
409 code = InitializeDB(adbase);
414 * \brief Main interaction loop for the recovery manager
416 * The recovery light-weight process only runs when you're the
417 * synchronization site. It performs the following tasks, if and only
418 * if the prerequisite tasks have been performed successfully (it
419 * keeps track of which ones have been performed in its bit map,
420 * \p urecovery_state).
422 * First, it is responsible for probing that all servers are up. This
423 * is the only operation that must be performed even if this is not
424 * yet the sync site, since otherwise this site may not notice that
425 * enough other machines are running to even elect this guy to be the
428 * After that, the recovery process does nothing until the beacon and
429 * voting modules manage to get this site elected sync site.
431 * After becoming sync site, recovery first attempts to find the best
432 * database available in the network (it must do this in order to
433 * ensure finding the latest committed data). After finding the right
434 * database, it must fetch this dbase to the sync site.
436 * After fetching the dbase, it relabels it with a new version number,
437 * to ensure that everyone recognizes this dbase as the most recent
440 * One the dbase has been relabelled, this machine can start handling
441 * requests. However, the recovery module still has one more task:
442 * propagating the dbase out to everyone who is up in the network.
445 urecovery_Interact(void *dummy)
447 afs_int32 code, tcode;
448 struct ubik_server *bestServer = NULL;
449 struct ubik_server *ts;
450 int dbok, doingRPC, now;
451 afs_int32 lastProbeTime, lastDBVCheck;
452 /* if we're the sync site, the best db version we've found yet */
453 static struct ubik_version bestDBVersion;
454 struct ubik_version tversion;
456 int length, tlen, offset, file, nbytes;
457 struct rx_call *rxcall;
459 struct ubik_stat ubikstat;
460 struct in_addr inAddr;
461 #ifndef OLD_URECOVERY
467 /* otherwise, begin interaction */
472 /* Run through this loop every 4 seconds */
475 #ifdef AFS_PTHREAD_ENV
476 select(0, 0, 0, 0, &tv);
478 IOMGR_Select(0, 0, 0, 0, &tv);
481 ubik_dprint("recovery running in state %x\n", urecovery_state);
483 /* Every 30 seconds, check all the down servers and mark them
484 * as up if they respond. When a server comes up or found to
485 * not be current, then re-find the the best database and
488 if ((now = FT_ApproxTime()) > 30 + lastProbeTime) {
489 for (ts = ubik_servers, doingRPC = 0; ts; ts = ts->next) {
495 urecovery_state &= ~UBIK_RECFOUNDDB;
497 } else if (!ts->currentDB) {
498 urecovery_state &= ~UBIK_RECFOUNDDB;
502 now = FT_ApproxTime();
506 /* Mark whether we are the sync site */
507 if (!ubeacon_AmSyncSite()) {
508 urecovery_state &= ~UBIK_RECSYNCSITE;
509 continue; /* nothing to do */
511 urecovery_state |= UBIK_RECSYNCSITE;
513 /* If a server has just come up or if we have not found the
514 * most current database, then go find the most current db.
516 if (!(urecovery_state & UBIK_RECFOUNDDB)) {
517 bestServer = (struct ubik_server *)0;
518 bestDBVersion.epoch = 0;
519 bestDBVersion.counter = 0;
520 for (ts = ubik_servers; ts; ts = ts->next) {
522 continue; /* don't bother with these guys */
525 code = DISK_GetVersion(ts->disk_rxcid, &ts->version);
527 /* perhaps this is the best version */
528 if (vcmp(ts->version, bestDBVersion) > 0) {
529 /* new best version */
530 bestDBVersion = ts->version;
535 /* take into consideration our version. Remember if we,
536 * the sync site, have the best version. Also note that
537 * we may need to send the best version out.
539 if (vcmp(ubik_dbase->version, bestDBVersion) >= 0) {
540 bestDBVersion = ubik_dbase->version;
541 bestServer = (struct ubik_server *)0;
542 urecovery_state |= UBIK_RECHAVEDB;
544 /* Clear the flag only when we know we have to retrieve
545 * the db. Because urecovery_AllBetter() looks at it.
547 urecovery_state &= ~UBIK_RECHAVEDB;
549 lastDBVCheck = FT_ApproxTime();
550 urecovery_state |= UBIK_RECFOUNDDB;
551 urecovery_state &= ~UBIK_RECSENTDB;
553 #if defined(UBIK_PAUSE)
554 /* it's not possible for UBIK_RECFOUNDDB not to be set here.
555 * However, we might have lost UBIK_RECSYNCSITE, and that
558 if (!(urecovery_state & UBIK_RECSYNCSITE))
559 continue; /* lost sync */
561 if (!(urecovery_state & UBIK_RECFOUNDDB))
562 continue; /* not ready */
563 #endif /* UBIK_PAUSE */
565 /* If we, the sync site, do not have the best db version, then
566 * go and get it from the server that does.
568 if ((urecovery_state & UBIK_RECHAVEDB) || !bestServer) {
569 urecovery_state |= UBIK_RECHAVEDB;
571 /* we don't have the best version; we should fetch it. */
573 urecovery_AbortAll(ubik_dbase);
575 /* Rx code to do the Bulk fetch */
578 rxcall = rx_NewCall(bestServer->disk_rxcid);
580 ubik_print("Ubik: Synchronize database with server %s\n",
581 afs_inet_ntoa(bestServer->addr[0]));
583 code = StartDISK_GetFile(rxcall, file);
585 ubik_dprint("StartDiskGetFile failed=%d\n", code);
588 nbytes = rx_Read(rxcall, (char *)&length, sizeof(afs_int32));
589 length = ntohl(length);
590 if (nbytes != sizeof(afs_int32)) {
591 ubik_dprint("Rx-read length error=%d\n", code = BULK_ERROR);
597 /* Truncate the file first */
598 code = (*ubik_dbase->truncate) (ubik_dbase, file, 0);
600 ubik_dprint("truncate io error=%d\n", code);
603 tversion.counter = 0;
605 /* give invalid label during file transit */
607 code = (*ubik_dbase->setlabel) (ubik_dbase, file, &tversion);
609 ubik_dprint("setlabel io error=%d\n", code);
612 #ifndef OLD_URECOVERY
614 afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB0.TMP", ubik_dbase->pathName);
615 fd = open(pbuffer, O_CREAT | O_RDWR | O_TRUNC, 0600);
620 code = lseek(fd, HDRSIZE, 0);
621 if (code != HDRSIZE) {
629 tlen = (length > sizeof(tbuffer) ? sizeof(tbuffer) : length);
630 #ifndef AFS_PTHREAD_ENV
634 nbytes = rx_Read(rxcall, tbuffer, tlen);
635 if (nbytes != tlen) {
636 ubik_dprint("Rx-read bulk error=%d\n", code = BULK_ERROR);
643 (*ubik_dbase->write) (ubik_dbase, file, tbuffer, offset,
646 nbytes = write(fd, tbuffer, tlen);
649 if (nbytes != tlen) {
657 #ifndef OLD_URECOVERY
662 code = EndDISK_GetFile(rxcall, &tversion);
664 tcode = rx_EndCall(rxcall, code);
668 /* we got a new file, set up its header */
669 urecovery_state |= UBIK_RECHAVEDB;
670 memcpy(&ubik_dbase->version, &tversion,
671 sizeof(struct ubik_version));
673 (*ubik_dbase->sync) (ubik_dbase, 0); /* get data out first */
675 afs_snprintf(tbuffer, sizeof(tbuffer), "%s.DB0", ubik_dbase->pathName);
677 afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB0.OLD", ubik_dbase->pathName);
678 code = unlink(pbuffer);
680 code = rename(tbuffer, pbuffer);
681 afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB0.TMP", ubik_dbase->pathName);
684 code = rename(pbuffer, tbuffer);
686 (*ubik_dbase->open) (ubik_dbase, 0);
688 /* after data is good, sync disk with correct label */
690 (*ubik_dbase->setlabel) (ubik_dbase, 0,
691 &ubik_dbase->version);
692 #ifndef OLD_URECOVERY
695 afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB0.OLD", ubik_dbase->pathName);
701 #ifndef OLD_URECOVERY
704 * We will effectively invalidate the old data forever now.
705 * Unclear if we *should* but we do.
708 ubik_dbase->version.epoch = 0;
709 ubik_dbase->version.counter = 0;
710 ubik_print("Ubik: Synchronize database failed (error = %d)\n",
713 ubik_print("Ubik: Synchronize database completed\n");
714 urecovery_state |= UBIK_RECHAVEDB;
716 udisk_Invalidate(ubik_dbase, 0); /* data has changed */
717 #ifdef AFS_PTHREAD_ENV
718 assert(pthread_cond_broadcast(&ubik_dbase->version_cond) == 0);
720 LWP_NoYieldSignal(&ubik_dbase->version);
724 #if defined(UBIK_PAUSE)
725 if (!(urecovery_state & UBIK_RECSYNCSITE))
726 continue; /* lost sync */
727 #endif /* UBIK_PAUSE */
728 if (!(urecovery_state & UBIK_RECHAVEDB))
729 continue; /* not ready */
731 /* If the database was newly initialized, then when we establish quorum, write
732 * a new label. This allows urecovery_AllBetter() to allow access for reads.
733 * Setting it to 2 also allows another site to come along with a newer
734 * database and overwrite this one.
736 if (ubik_dbase->version.epoch == 1) {
738 urecovery_AbortAll(ubik_dbase);
740 ubik_dbase->version.epoch = ubik_epochTime;
741 ubik_dbase->version.counter = 1;
743 (*ubik_dbase->setlabel) (ubik_dbase, 0, &ubik_dbase->version);
744 udisk_Invalidate(ubik_dbase, 0); /* data may have changed */
745 #ifdef AFS_PTHREAD_ENV
746 assert(pthread_cond_broadcast(&ubik_dbase->version_cond) == 0);
748 LWP_NoYieldSignal(&ubik_dbase->version);
753 /* Check the other sites and send the database to them if they
754 * do not have the current db.
756 if (!(urecovery_state & UBIK_RECSENTDB)) {
757 /* now propagate out new version to everyone else */
758 dbok = 1; /* start off assuming they all worked */
762 * Check if a write transaction is in progress. We can't send the
763 * db when a write is in progress here because the db would be
764 * obsolete as soon as it goes there. Also, ops after the begin
765 * trans would reach the recepient and wouldn't find a transaction
766 * pending there. Frankly, I don't think it's possible to get past
767 * the write-lock above if there is a write transaction in progress,
768 * but then, it won't hurt to check, will it?
770 if (ubik_dbase->flags & DBWRITING) {
775 while ((ubik_dbase->flags & DBWRITING) && (safety < 500)) {
777 /* sleep for a little while */
778 #ifdef AFS_PTHREAD_ENV
779 select(0, 0, 0, 0, &tv);
781 IOMGR_Select(0, 0, 0, 0, &tv);
789 for (ts = ubik_servers; ts; ts = ts->next) {
790 inAddr.s_addr = ts->addr[0];
792 ubik_dprint("recovery cannot send version to %s\n",
793 afs_inet_ntoa(inAddr.s_addr));
797 ubik_dprint("recovery sending version to %s\n",
798 afs_inet_ntoa(inAddr.s_addr));
799 if (vcmp(ts->version, ubik_dbase->version) != 0) {
800 ubik_dprint("recovery stating local database\n");
802 /* Rx code to do the Bulk Store */
803 code = (*ubik_dbase->stat) (ubik_dbase, 0, &ubikstat);
805 length = ubikstat.size;
807 rxcall = rx_NewCall(ts->disk_rxcid);
809 StartDISK_SendFile(rxcall, file, length,
810 &ubik_dbase->version);
812 ubik_dprint("StartDiskSendFile failed=%d\n",
819 sizeof(tbuffer) ? sizeof(tbuffer) : length);
821 (*ubik_dbase->read) (ubik_dbase, file,
822 tbuffer, offset, tlen);
823 if (nbytes != tlen) {
824 ubik_dprint("Local disk read error=%d\n",
828 nbytes = rx_Write(rxcall, tbuffer, tlen);
829 if (nbytes != tlen) {
830 ubik_dprint("Rx-write bulk error=%d\n", code =
837 code = EndDISK_SendFile(rxcall);
839 code = rx_EndCall(rxcall, code);
842 /* we set a new file, process its header */
843 ts->version = ubik_dbase->version;
848 /* mark file up to date */
854 urecovery_state |= UBIK_RECSENTDB;
861 * \brief send a Probe to all the network address of this server
863 * \return 0 if success, else return 1
866 DoProbe(struct ubik_server *server)
868 struct rx_connection *conns[UBIK_MAX_INTERFACE_ADDR];
869 struct rx_connection *connSuccess = 0;
873 extern afs_int32 ubikSecIndex;
874 extern struct rx_securityClass *ubikSecClass;
876 for (i = 0; (addr = server->addr[i]) && (i < UBIK_MAX_INTERFACE_ADDR);
879 rx_NewConnection(addr, ubik_callPortal, DISK_SERVICE_ID,
880 ubikSecClass, ubikSecIndex);
882 /* user requirement to use only the primary interface */
883 if (ubikPrimaryAddrOnly) {
888 assert(i); /* at least one interface address for this server */
892 if (!multi_error) { /* first success */
893 addr = server->addr[multi_i]; /* successful interface addr */
895 if (server->disk_rxcid) /* destroy existing conn */
896 rx_DestroyConnection(server->disk_rxcid);
897 if (server->vote_rxcid)
898 rx_DestroyConnection(server->vote_rxcid);
900 /* make new connections */
901 server->disk_rxcid = conns[multi_i];
902 server->vote_rxcid = rx_NewConnection(addr, ubik_callPortal, VOTE_SERVICE_ID, ubikSecClass, ubikSecIndex); /* for vote reqs */
904 connSuccess = conns[multi_i];
905 strcpy(buffer, (char *)afs_inet_ntoa(server->addr[0]));
907 ("ubik:server %s is back up: will be contacted through %s\n",
908 buffer, afs_inet_ntoa(addr));
914 /* Destroy all connections except the one on which we succeeded */
915 for (j = 0; j < i; j++)
916 if (conns[j] != connSuccess)
917 rx_DestroyConnection(conns[j]);
920 ubik_dprint("ubik:server %s still down\n",
921 afs_inet_ntoa(server->addr[0]));
924 return 0; /* success */
926 return 1; /* failure */