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>
23 #include <netinet/in.h>
32 #include <afs/afsutil.h>
34 #define UBIK_INTERNALS
38 /* This module is responsible for determining when the system has
39 * recovered to the point that it can handle new transactions. It
40 * replays logs, polls to determine the current dbase after a crash,
41 * and distributes the new database to the others.
44 /* The sync site associates a version number with each database. It
45 * broadcasts the version associated with its current dbase in every
46 * one of its beacon messages. When the sync site send a dbase to a
47 * server, it also sends the db's version. A non-sync site server can
48 * tell if it has the right dbase version by simply comparing the
49 * version from the beacon message (uvote_dbVersion) with the version
50 * associated with the database (ubik_dbase->version). The sync site
51 * itself simply has one counter to keep track of all of this (again
52 * ubik_dbase->version).
55 /* sync site: routine called when the sync site loses its quorum; this
56 * procedure is called "up" from the beacon package. It resyncs the
57 * dbase and nudges the recovery daemon to try to propagate out the
58 * changes. It also resets the recovery daemon's state, since
59 * recovery must potentially find a new dbase to propagate out. This
60 * routine should not do anything with variables used by non-sync site
64 /* if this flag is set, then ubik will use only the primary address
65 ** ( the address specified in the CellServDB) to contact other
66 ** ubik servers. Ubik recovery will not try opening connections
67 ** to the alternate interface addresses.
69 int ubikPrimaryAddrOnly;
72 urecovery_ResetState(void)
75 #if !defined(AFS_PTHREAD_ENV)
76 /* No corresponding LWP_WaitProcess found anywhere for this -- klm */
77 LWP_NoYieldSignal(&urecovery_state);
82 /* sync site: routine called when a non-sync site server goes down; restarts recovery
83 * process to send missing server the new db when it comes back up.
84 * This routine should not do anything with variables used by non-sync site servers.
87 urecovery_LostServer(void)
89 #if !defined(AFS_PTHREAD_ENV)
90 /* No corresponding LWP_WaitProcess found anywhere for this -- klm */
91 LWP_NoYieldSignal(&urecovery_state);
96 /* return true iff we have a current database (called by both sync
97 * sites and non-sync sites) How do we determine this? If we're the
98 * sync site, we wait until recovery has finished fetching and
99 * re-labelling its dbase (it may still be trying to propagate it out
100 * to everyone else; that's THEIR problem). If we're not the sync
101 * site, then we must have a dbase labelled with the right version,
102 * and we must have a currently-good sync site.
105 urecovery_AllBetter(register struct ubik_dbase *adbase, int areadAny)
107 register afs_int32 rcode;
109 ubik_dprint("allbetter checking\n");
114 if (ubik_dbase->version.epoch > 1)
115 rcode = 1; /* Happy with any good version of database */
118 /* Check if we're sync site and we've got the right data */
119 else if (ubeacon_AmSyncSite() && (urecovery_state & UBIK_RECHAVEDB)) {
123 /* next, check if we're aux site, and we've ever been sent the
124 * right data (note that if a dbase update fails, we won't think
125 * that the sync site is still the sync site, 'cause it won't talk
126 * to us until a timeout period has gone by. When we recover, we
127 * leave this clear until we get a new dbase */
128 else if ((uvote_GetSyncSite() && (vcmp(ubik_dbVersion, ubik_dbase->version) == 0))) { /* && order is important */
132 ubik_dprint("allbetter: returning %d\n", rcode);
136 /* abort all transactions on this database */
138 urecovery_AbortAll(struct ubik_dbase *adbase)
140 register struct ubik_trans *tt;
141 for (tt = adbase->activeTrans; tt; tt = tt->next) {
147 /* this routine aborts the current remote transaction, if any, if the tid is wrong */
149 urecovery_CheckTid(register struct ubik_tid *atid)
151 if (ubik_currentTrans) {
152 /* there is remote write trans, see if we match, see if this
153 * is a new transaction */
154 if (atid->epoch != ubik_currentTrans->tid.epoch
155 || atid->counter > ubik_currentTrans->tid.counter) {
156 /* don't match, abort it */
157 /* If the thread is not waiting for lock - ok to end it */
158 #if !defined(UBIK_PAUSE)
159 if (ubik_currentTrans->locktype != LOCKWAIT) {
160 #endif /* UBIK_PAUSE */
161 udisk_end(ubik_currentTrans);
162 #if !defined(UBIK_PAUSE)
164 #endif /* UBIK_PAUSE */
165 ubik_currentTrans = (struct ubik_trans *)0;
171 /* log format is defined here, and implicitly in disk.c
173 * 4 byte opcode, followed by parameters, each 4 bytes long. All integers
174 * are in logged in network standard byte order, in case we want to move logs
175 * from machine-to-machine someday.
177 * Begin transaction: opcode
178 * Commit transaction: opcode, version (8 bytes)
179 * Truncate file: opcode, file number, length
180 * Abort transaction: opcode
181 * Write data: opcode, file, position, length, <length> data bytes
183 * A very simple routine, it just replays the log. Note that this is a new-value only log, which
184 * implies that no uncommitted data is written to the dbase: one writes data to the log, including
185 * the commit record, then we allow data to be written through to the dbase. In our particular
186 * implementation, once a transaction is done, we write out the pages to the database, so that
187 * our buffer package doesn't have to know about stable and uncommitted data in the memory buffers:
188 * any changed data while there is an uncommitted write transaction can be zapped during an
189 * abort and the remaining dbase on the disk is exactly the right dbase, without having to read
195 ReplayLog(register struct ubik_dbase *adbase)
198 register afs_int32 code, tpos;
200 afs_int32 len, thisSize, tfile, filePos;
202 afs_int32 syncFile = -1;
203 afs_int32 data[1024];
205 /* read the lock twice, once to see whether we have a transaction to deal
206 * with that committed, (theoretically, we should support more than one
207 * trans in the log at once, but not yet), and once replaying the
211 /* for now, assume that all ops in log pertain to one transaction; see if there's a commit */
214 (*adbase->read) (adbase, LOGFILE, (char *)&opcode, tpos,
216 if (code != sizeof(afs_int32))
218 if (opcode == LOGNEW) {
219 /* handle begin trans */
220 tpos += sizeof(afs_int32);
221 } else if (opcode == LOGABORT)
223 else if (opcode == LOGEND) {
226 } else if (opcode == LOGTRUNCATE) {
229 (*adbase->read) (adbase, LOGFILE, (char *)buffer, tpos,
230 2 * sizeof(afs_int32));
231 if (code != 2 * sizeof(afs_int32))
232 break; /* premature eof or io error */
233 tpos += 2 * sizeof(afs_int32);
234 } else if (opcode == LOGDATA) {
237 (*adbase->read) (adbase, LOGFILE, (char *)buffer, tpos,
238 3 * sizeof(afs_int32));
239 if (code != 3 * sizeof(afs_int32))
241 /* otherwise, skip over the data bytes, too */
242 tpos += buffer[2] + 3 * sizeof(afs_int32);
244 ubik_dprint("corrupt log opcode (%d) at position %d\n", opcode,
246 break; /* corrupt log! */
250 /* actually do the replay; log should go all the way through the commit record, since
251 * we just read it above. */
257 (*adbase->read) (adbase, LOGFILE, (char *)&opcode, tpos,
259 if (code != sizeof(afs_int32))
261 if (opcode == LOGNEW) {
262 /* handle begin trans */
263 tpos += sizeof(afs_int32);
264 } else if (opcode == LOGABORT)
265 panic("log abort\n");
266 else if (opcode == LOGEND) {
269 (*adbase->read) (adbase, LOGFILE, (char *)buffer, tpos,
270 2 * sizeof(afs_int32));
271 if (code != 2 * sizeof(afs_int32))
273 code = (*adbase->setlabel) (adbase, 0, (ubik_version *)buffer);
277 break; /* all done now */
278 } else if (opcode == LOGTRUNCATE) {
281 (*adbase->read) (adbase, LOGFILE, (char *)buffer, tpos,
282 2 * sizeof(afs_int32));
283 if (code != 2 * sizeof(afs_int32))
284 break; /* premature eof or io error */
285 tpos += 2 * sizeof(afs_int32);
287 (*adbase->truncate) (adbase, ntohl(buffer[0]),
291 } else if (opcode == LOGDATA) {
294 (*adbase->read) (adbase, LOGFILE, (char *)buffer, tpos,
295 3 * sizeof(afs_int32));
296 if (code != 3 * sizeof(afs_int32))
298 tpos += 3 * sizeof(afs_int32);
299 /* otherwise, skip over the data bytes, too */
300 len = ntohl(buffer[2]); /* total number of bytes to copy */
301 filePos = ntohl(buffer[1]);
302 tfile = ntohl(buffer[0]);
303 /* try to minimize file syncs */
304 if (syncFile != tfile) {
306 code = (*adbase->sync) (adbase, syncFile);
314 thisSize = (len > sizeof(data) ? sizeof(data) : len);
315 /* copy sizeof(data) buffer bytes at a time */
317 (*adbase->read) (adbase, LOGFILE, (char *)data, tpos,
319 if (code != thisSize)
322 (*adbase->write) (adbase, tfile, (char *)data, filePos,
324 if (code != thisSize)
331 ubik_dprint("corrupt log opcode (%d) at position %d\n",
333 break; /* corrupt log! */
338 code = (*adbase->sync) (adbase, syncFile);
342 ubik_dprint("Log read error on pass 2\n");
347 /* now truncate the log, we're done with it */
348 code = (*adbase->truncate) (adbase, LOGFILE, 0);
352 /* Called at initialization to figure out version of the dbase we really have.
353 * This routine is called after replaying the log; it reads the restored labels.
356 InitializeDB(register struct ubik_dbase *adbase)
358 register afs_int32 code;
360 code = (*adbase->getlabel) (adbase, 0, &adbase->version);
362 /* try setting the label to a new value */
363 adbase->version.epoch = 1; /* value for newly-initialized db */
364 adbase->version.counter = 1;
365 code = (*adbase->setlabel) (adbase, 0, &adbase->version);
367 /* failed, try to set it back */
368 adbase->version.epoch = 0;
369 adbase->version.counter = 0;
370 (*adbase->setlabel) (adbase, 0, &adbase->version);
372 #ifdef AFS_PTHREAD_ENV
373 assert(pthread_cond_broadcast(&adbase->version_cond) == 0);
375 LWP_NoYieldSignal(&adbase->version);
381 /* initialize the local dbase
382 * We replay the logs and then read the resulting file to figure out what version we've really got.
385 urecovery_Initialize(register struct ubik_dbase *adbase)
387 register afs_int32 code;
389 code = ReplayLog(adbase);
392 code = InitializeDB(adbase);
396 /* Main interaction loop for the recovery manager
397 * The recovery light-weight process only runs when you're the
398 * synchronization site. It performs the following tasks, if and only
399 * if the prerequisite tasks have been performed successfully (it
400 * keeps track of which ones have been performed in its bit map,
403 * First, it is responsible for probing that all servers are up. This
404 * is the only operation that must be performed even if this is not
405 * yet the sync site, since otherwise this site may not notice that
406 * enough other machines are running to even elect this guy to be the
409 * After that, the recovery process does nothing until the beacon and
410 * voting modules manage to get this site elected sync site.
412 * After becoming sync site, recovery first attempts to find the best
413 * database available in the network (it must do this in order to
414 * ensure finding the latest committed data). After finding the right
415 * database, it must fetch this dbase to the sync site.
417 * After fetching the dbase, it relabels it with a new version number,
418 * to ensure that everyone recognizes this dbase as the most recent
421 * One the dbase has been relabelled, this machine can start handling
422 * requests. However, the recovery module still has one more task:
423 * propagating the dbase out to everyone who is up in the network.
426 urecovery_Interact(void *dummy)
428 afs_int32 code, tcode;
429 struct ubik_server *bestServer = NULL;
430 struct ubik_server *ts;
431 int dbok, doingRPC, now;
432 afs_int32 lastProbeTime, lastDBVCheck;
433 /* if we're the sync site, the best db version we've found yet */
434 static struct ubik_version bestDBVersion;
435 struct ubik_version tversion;
437 int length, tlen, offset, file, nbytes;
438 struct rx_call *rxcall;
440 struct ubik_stat ubikstat;
441 struct in_addr inAddr;
442 #ifndef OLD_URECOVERY
445 afs_int32 epoch, pass;
448 /* otherwise, begin interaction */
453 /* Run through this loop every 4 seconds */
456 #ifdef AFS_PTHREAD_ENV
457 select(0, 0, 0, 0, &tv);
459 IOMGR_Select(0, 0, 0, 0, &tv);
462 ubik_dprint("recovery running in state %x\n", urecovery_state);
464 /* Every 30 seconds, check all the down servers and mark them
465 * as up if they respond. When a server comes up or found to
466 * not be current, then re-find the the best database and
469 if ((now = FT_ApproxTime()) > 30 + lastProbeTime) {
470 for (ts = ubik_servers, doingRPC = 0; ts; ts = ts->next) {
476 urecovery_state &= ~UBIK_RECFOUNDDB;
478 } else if (!ts->currentDB) {
479 urecovery_state &= ~UBIK_RECFOUNDDB;
483 now = FT_ApproxTime();
487 /* Mark whether we are the sync site */
488 if (!ubeacon_AmSyncSite()) {
489 urecovery_state &= ~UBIK_RECSYNCSITE;
490 continue; /* nothing to do */
492 urecovery_state |= UBIK_RECSYNCSITE;
494 /* If a server has just come up or if we have not found the
495 * most current database, then go find the most current db.
497 if (!(urecovery_state & UBIK_RECFOUNDDB)) {
498 bestServer = (struct ubik_server *)0;
499 bestDBVersion.epoch = 0;
500 bestDBVersion.counter = 0;
501 for (ts = ubik_servers; ts; ts = ts->next) {
503 continue; /* don't bother with these guys */
506 code = DISK_GetVersion(ts->disk_rxcid, &ts->version);
508 /* perhaps this is the best version */
509 if (vcmp(ts->version, bestDBVersion) > 0) {
510 /* new best version */
511 bestDBVersion = ts->version;
516 /* take into consideration our version. Remember if we,
517 * the sync site, have the best version. Also note that
518 * we may need to send the best version out.
520 if (vcmp(ubik_dbase->version, bestDBVersion) >= 0) {
521 bestDBVersion = ubik_dbase->version;
522 bestServer = (struct ubik_server *)0;
523 urecovery_state |= UBIK_RECHAVEDB;
525 /* Clear the flag only when we know we have to retrieve
526 * the db. Because urecovery_AllBetter() looks at it.
528 urecovery_state &= ~UBIK_RECHAVEDB;
530 lastDBVCheck = FT_ApproxTime();
531 urecovery_state |= UBIK_RECFOUNDDB;
532 urecovery_state &= ~UBIK_RECSENTDB;
534 #if defined(UBIK_PAUSE)
535 /* it's not possible for UBIK_RECFOUNDDB not to be set here.
536 * However, we might have lost UBIK_RECSYNCSITE, and that
539 if (!(urecovery_state & UBIK_RECSYNCSITE))
540 continue; /* lost sync */
542 if (!(urecovery_state & UBIK_RECFOUNDDB))
543 continue; /* not ready */
544 #endif /* UBIK_PAUSE */
546 /* If we, the sync site, do not have the best db version, then
547 * go and get it from the server that does.
549 if ((urecovery_state & UBIK_RECHAVEDB) || !bestServer) {
550 urecovery_state |= UBIK_RECHAVEDB;
552 /* we don't have the best version; we should fetch it. */
554 urecovery_AbortAll(ubik_dbase);
556 /* Rx code to do the Bulk fetch */
559 rxcall = rx_NewCall(bestServer->disk_rxcid);
561 ubik_print("Ubik: Synchronize database with server %s\n",
562 afs_inet_ntoa(bestServer->addr[0]));
564 code = StartDISK_GetFile(rxcall, file);
566 ubik_dprint("StartDiskGetFile failed=%d\n", code);
569 nbytes = rx_Read(rxcall, (char *)&length, sizeof(afs_int32));
570 length = ntohl(length);
571 if (nbytes != sizeof(afs_int32)) {
572 ubik_dprint("Rx-read length error=%d\n", code = BULK_ERROR);
578 /* Truncate the file first */
579 code = (*ubik_dbase->truncate) (ubik_dbase, file, 0);
581 ubik_dprint("truncate io error=%d\n", code);
584 tversion.counter = 0;
586 /* give invalid label during file transit */
588 code = (*ubik_dbase->setlabel) (ubik_dbase, file, &tversion);
590 ubik_dprint("setlabel io error=%d\n", code);
593 #ifndef OLD_URECOVERY
595 afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB0.TMP", ubik_dbase->pathName);
596 fd = open(pbuffer, O_CREAT | O_RDWR | O_TRUNC, 0600);
601 code = lseek(fd, HDRSIZE, 0);
602 if (code != HDRSIZE) {
610 tlen = (length > sizeof(tbuffer) ? sizeof(tbuffer) : length);
611 #ifndef AFS_PTHREAD_ENV
615 nbytes = rx_Read(rxcall, tbuffer, tlen);
616 if (nbytes != tlen) {
617 ubik_dprint("Rx-read bulk error=%d\n", code = BULK_ERROR);
624 (*ubik_dbase->write) (ubik_dbase, file, tbuffer, offset,
627 nbytes = write(fd, tbuffer, tlen);
630 if (nbytes != tlen) {
638 #ifndef OLD_URECOVERY
643 code = EndDISK_GetFile(rxcall, &tversion);
645 tcode = rx_EndCall(rxcall, code);
649 /* we got a new file, set up its header */
650 urecovery_state |= UBIK_RECHAVEDB;
651 memcpy(&ubik_dbase->version, &tversion,
652 sizeof(struct ubik_version));
654 (*ubik_dbase->sync) (ubik_dbase, 0); /* get data out first */
656 afs_snprintf(tbuffer, sizeof(tbuffer), "%s.DB0", ubik_dbase->pathName);
658 afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB0.OLD", ubik_dbase->pathName);
659 code = unlink(pbuffer);
661 code = rename(tbuffer, pbuffer);
662 afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB0.TMP", ubik_dbase->pathName);
665 code = rename(pbuffer, tbuffer);
667 code = (*ubik_dbase->open) (ubik_dbase, 0);
670 /* after data is good, sync disk with correct label */
672 (*ubik_dbase->setlabel) (ubik_dbase, 0,
673 &ubik_dbase->version);
674 #ifndef OLD_URECOVERY
676 afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB0.OLD", ubik_dbase->pathName);
682 #ifndef OLD_URECOVERY
685 * We will effectively invalidate the old data forever now.
686 * Unclear if we *should* but we do.
689 ubik_dbase->version.epoch = 0;
690 ubik_dbase->version.counter = 0;
691 ubik_print("Ubik: Synchronize database failed (error = %d)\n",
694 ubik_print("Ubik: Synchronize database completed\n");
695 urecovery_state |= UBIK_RECHAVEDB;
697 udisk_Invalidate(ubik_dbase, 0); /* data has changed */
698 #ifdef AFS_PTHREAD_ENV
699 assert(pthread_cond_broadcast(&ubik_dbase->version_cond) == 0);
701 LWP_NoYieldSignal(&ubik_dbase->version);
705 #if defined(UBIK_PAUSE)
706 if (!(urecovery_state & UBIK_RECSYNCSITE))
707 continue; /* lost sync */
708 #endif /* UBIK_PAUSE */
709 if (!(urecovery_state & UBIK_RECHAVEDB))
710 continue; /* not ready */
712 /* If the database was newly initialized, then when we establish quorum, write
713 * a new label. This allows urecovery_AllBetter() to allow access for reads.
714 * Setting it to 2 also allows another site to come along with a newer
715 * database and overwrite this one.
717 if (ubik_dbase->version.epoch == 1) {
719 urecovery_AbortAll(ubik_dbase);
721 ubik_dbase->version.epoch = ubik_epochTime;
722 ubik_dbase->version.counter = 1;
724 (*ubik_dbase->setlabel) (ubik_dbase, 0, &ubik_dbase->version);
725 udisk_Invalidate(ubik_dbase, 0); /* data may have changed */
726 #ifdef AFS_PTHREAD_ENV
727 assert(pthread_cond_broadcast(&ubik_dbase->version_cond) == 0);
729 LWP_NoYieldSignal(&ubik_dbase->version);
734 /* Check the other sites and send the database to them if they
735 * do not have the current db.
737 if (!(urecovery_state & UBIK_RECSENTDB)) {
738 /* now propagate out new version to everyone else */
739 dbok = 1; /* start off assuming they all worked */
743 * Check if a write transaction is in progress. We can't send the
744 * db when a write is in progress here because the db would be
745 * obsolete as soon as it goes there. Also, ops after the begin
746 * trans would reach the recepient and wouldn't find a transaction
747 * pending there. Frankly, I don't think it's possible to get past
748 * the write-lock above if there is a write transaction in progress,
749 * but then, it won't hurt to check, will it?
751 if (ubik_dbase->flags & DBWRITING) {
756 while ((ubik_dbase->flags & DBWRITING) && (safety < 500)) {
758 /* sleep for a little while */
759 #ifdef AFS_PTHREAD_ENV
760 select(0, 0, 0, 0, &tv);
762 IOMGR_Select(0, 0, 0, 0, &tv);
770 for (ts = ubik_servers; ts; ts = ts->next) {
771 inAddr.s_addr = ts->addr[0];
773 ubik_dprint("recovery cannot send version to %s\n",
774 afs_inet_ntoa(inAddr.s_addr));
778 ubik_dprint("recovery sending version to %s\n",
779 afs_inet_ntoa(inAddr.s_addr));
780 if (vcmp(ts->version, ubik_dbase->version) != 0) {
781 ubik_dprint("recovery stating local database\n");
783 /* Rx code to do the Bulk Store */
784 code = (*ubik_dbase->stat) (ubik_dbase, 0, &ubikstat);
786 length = ubikstat.size;
788 rxcall = rx_NewCall(ts->disk_rxcid);
790 StartDISK_SendFile(rxcall, file, length,
791 &ubik_dbase->version);
793 ubik_dprint("StartDiskSendFile failed=%d\n",
800 sizeof(tbuffer) ? sizeof(tbuffer) : length);
802 (*ubik_dbase->read) (ubik_dbase, file,
803 tbuffer, offset, tlen);
804 if (nbytes != tlen) {
805 ubik_dprint("Local disk read error=%d\n",
809 nbytes = rx_Write(rxcall, tbuffer, tlen);
810 if (nbytes != tlen) {
811 ubik_dprint("Rx-write bulk error=%d\n", code =
818 code = EndDISK_SendFile(rxcall);
820 code = rx_EndCall(rxcall, code);
823 /* we set a new file, process its header */
824 ts->version = ubik_dbase->version;
829 /* mark file up to date */
835 urecovery_state |= UBIK_RECSENTDB;
842 ** send a Probe to all the network address of this server
843 ** Return 0 if success, else return 1
846 DoProbe(struct ubik_server *server)
848 struct rx_connection *conns[UBIK_MAX_INTERFACE_ADDR];
849 struct rx_connection *connSuccess = 0;
853 extern afs_int32 ubikSecIndex;
854 extern struct rx_securityClass *ubikSecClass;
856 for (i = 0; (addr = server->addr[i]) && (i < UBIK_MAX_INTERFACE_ADDR);
859 rx_NewConnection(addr, ubik_callPortal, DISK_SERVICE_ID,
860 ubikSecClass, ubikSecIndex);
862 /* user requirement to use only the primary interface */
863 if (ubikPrimaryAddrOnly) {
868 assert(i); /* at least one interface address for this server */
872 if (!multi_error) { /* first success */
873 addr = server->addr[multi_i]; /* successful interface addr */
875 if (server->disk_rxcid) /* destroy existing conn */
876 rx_DestroyConnection(server->disk_rxcid);
877 if (server->vote_rxcid)
878 rx_DestroyConnection(server->vote_rxcid);
880 /* make new connections */
881 server->disk_rxcid = conns[multi_i];
882 server->vote_rxcid = rx_NewConnection(addr, ubik_callPortal, VOTE_SERVICE_ID, ubikSecClass, ubikSecIndex); /* for vote reqs */
884 connSuccess = conns[multi_i];
885 strcpy(buffer, (char *)afs_inet_ntoa(server->addr[0]));
887 ("ubik:server %s is back up: will be contacted through %s\n",
888 buffer, afs_inet_ntoa(addr));
894 /* Destroy all connections except the one on which we succeeded */
895 for (j = 0; j < i; j++)
896 if (conns[j] != connSuccess)
897 rx_DestroyConnection(conns[j]);
900 ubik_dprint("ubik:server %s still down\n",
901 afs_inet_ntoa(server->addr[0]));
904 return 0; /* success */
906 return 1; /* failure */