now = FT_ApproxTime();
if (beacon_globals.syncSiteUntil <= now) { /* if my votes have expired, say so */
if (beacon_globals.ubik_amSyncSite)
- ViceLog(5, ("Ubik: I am no longer the sync site\n"));
+ ViceLog(0, ("Ubik: I am no longer the sync site - my votes expired\n"));
beacon_globals.ubik_amSyncSite = 0;
beacon_globals.ubik_syncSiteAdvertised = 0;
rcode = 0;
if (ubik_singleServer) {
if (!beacon_globals.ubik_amSyncSite) {
- ViceLog(5, ("Ubik: I am the sync site - 1 server\n"));
+ ViceLog(0, ("Ubik: I am the sync site - 1 server\n"));
DBHOLD(ubik_dbase);
UBIK_VERSION_LOCK;
version_globals.ubik_epochTime = FT_ApproxTime();
if (yesVotes > nServers) { /* yesVotes is bumped by 2 or 3 for each site */
UBIK_BEACON_LOCK;
if (!beacon_globals.ubik_amSyncSite) {
- ViceLog(5, ("Ubik: I am the sync site\n"));
+ ViceLog(0, ("Ubik: I am the sync site\n"));
/* Defer actually changing any variables until we can take the
* DB lock (which is before the beacon lock in the lock order). */
becameSyncSite = 1;
} else {
UBIK_BEACON_LOCK;
if (beacon_globals.ubik_amSyncSite)
- ViceLog(5, ("Ubik: I am no longer the sync site\n"));
+ ViceLog(0, ("Ubik: I am no longer the sync site - I lost the election\n"));
beacon_globals.ubik_amSyncSite = 0;
beacon_globals.ubik_syncSiteAdvertised = 0;
UBIK_BEACON_UNLOCK;
code = StartDISK_GetFile(rxcall, file);
if (code) {
- ViceLog(5, ("StartDiskGetFile failed=%d\n", code));
+ ViceLog(0, ("StartDiskGetFile failed=%d\n", code));
goto FetchEndCall;
}
nbytes = rx_Read(rxcall, (char *)&length, sizeof(afs_int32));
length = ntohl(length);
if (nbytes != sizeof(afs_int32)) {
- ViceLog(5, ("Rx-read length error=%d\n", BULK_ERROR));
+ ViceLog(0, ("Rx-read length error=%d\n", BULK_ERROR));
code = EIO;
goto FetchEndCall;
}
code = (*ubik_dbase->setlabel) (ubik_dbase, file, &tversion);
UBIK_VERSION_UNLOCK;
if (code) {
- ViceLog(5, ("setlabel io error=%d\n", code));
+ ViceLog(0, ("setlabel io error=%d\n", code));
goto FetchEndCall;
}
snprintf(pbuffer, sizeof(pbuffer), "%s.DB%s%d.TMP",
#endif
nbytes = rx_Read(rxcall, tbuffer, tlen);
if (nbytes != tlen) {
- ViceLog(5, ("Rx-read bulk error=%d\n", BULK_ERROR));
+ ViceLog(0, ("Rx-read bulk error=%d\n", BULK_ERROR));
code = EIO;
close(fd);
goto FetchEndCall;
UBIK_BEACON_LOCK;
if (!ts->up) {
UBIK_BEACON_UNLOCK;
+ /* It would be nice to have this message at loglevel
+ * 0 as well, but it will log once every 4s for each
+ * down server while in this recovery state. This
+ * should only be changed to loglevel 0 if it is
+ * also rate-limited.
+ */
ViceLog(5, ("recovery cannot send version to %s\n",
afs_inet_ntoa_r(inAddr.s_addr, hoststr)));
dbok = 0;
StartDISK_SendFile(rxcall, file, length,
&ubik_dbase->version);
if (code) {
- ViceLog(5, ("StartDiskSendFile failed=%d\n",
+ ViceLog(0, ("StartDiskSendFile failed=%d\n",
code));
goto StoreEndCall;
}
tbuffer, offset, tlen);
if (nbytes != tlen) {
code = UIOERROR;
- ViceLog(5, ("Local disk read error=%d\n", code));
+ ViceLog(0, ("Local disk read error=%d\n", code));
goto StoreEndCall;
}
nbytes = rx_Write(rxcall, tbuffer, tlen);
if (nbytes != tlen) {
code = BULK_ERROR;
- ViceLog(5, ("Rx-write bulk error=%d\n", code));
+ ViceLog(0, ("Rx-write bulk error=%d\n", code));
goto StoreEndCall;
}
offset += tlen;
code = rx_Write(rxcall, (char *)&tlen, sizeof(afs_int32));
if (code != sizeof(afs_int32)) {
DBRELE(dbase);
- ViceLog(5, ("Rx-write length error=%d\n", code));
+ ViceLog(0, ("Rx-write length error=%d\n", code));
return BULK_ERROR;
}
offset = 0;
code = (*dbase->read) (dbase, file, tbuffer, offset, tlen);
if (code != tlen) {
DBRELE(dbase);
- ViceLog(5, ("read failed error=%d\n", code));
+ ViceLog(0, ("read failed error=%d\n", code));
return UIOERROR;
}
code = rx_Write(rxcall, tbuffer, tlen);
if (code != tlen) {
DBRELE(dbase);
- ViceLog(5, ("Rx-write length error=%d\n", code));
+ ViceLog(0, ("Rx-write length error=%d\n", code));
return BULK_ERROR;
}
length -= tlen;
#endif
code = rx_Read(rxcall, tbuffer, tlen);
if (code != tlen) {
- ViceLog(5, ("Rx-read length error=%d\n", code));
+ ViceLog(0, ("Rx-read length error=%d\n", code));
code = BULK_ERROR;
close(fd);
goto failed;
code = write(fd, tbuffer, tlen);
pass++;
if (code != tlen) {
- ViceLog(5, ("write failed error=%d\n", code));
+ ViceLog(0, ("write failed tlen=%d, error=%d\n", tlen, code));
code = UIOERROR;
close(fd);
goto failed;
rx_NewService(0, VOTE_SERVICE_ID, "VOTE", ubik_sc, numClasses,
VOTE_ExecuteRequest);
if (tservice == (struct rx_service *)0) {
- ViceLog(5, ("Could not create VOTE rx service!\n"));
+ ViceLog(0, ("Could not create VOTE rx service!\n"));
return -1;
}
rx_SetMinProcs(tservice, 2);
rx_NewService(0, DISK_SERVICE_ID, "DISK", ubik_sc, numClasses,
DISK_ExecuteRequest);
if (tservice == (struct rx_service *)0) {
- ViceLog(5, ("Could not create DISK rx service!\n"));
+ ViceLog(0, ("Could not create DISK rx service!\n"));
return -1;
}
rx_SetMinProcs(tservice, 2);
break;
}
if (!ts)
- ViceLog(5, ("Unknown host %x has sent a beacon\n", otherHost));
+ ViceLog(0, ("Unknown host %x has sent a beacon\n", otherHost));
if (ts && ts->isClone)
isClone = 1;
} else {
vote_globals.syncTime = now;
} else if (vote_globals.syncTime + BIGTIME < now) {
if (vote_globals.syncHost) {
- ViceLog(5, ("Ubik: Lost contact with sync-site %s (NOT in quorum)\n",
+ ViceLog(0, ("Ubik: Lost contact with sync-site %s (NOT in quorum)\n",
afs_inet_ntoa_r(vote_globals.syncHost, hoststr)));
}
vote_globals.syncHost = 0;
if ((vote_globals.ubik_lastYesTime + BIGTIME < now) || (otherHost != vote_globals.lastYesHost)
|| (vote_globals.lastYesState != astate)) {
/* A new vote or a change in the vote or changed quorum */
+ /* XXX This should be at loglevel 0, but the conditionals
+ * ought to be reworked first to prevent excessive logging.
+ */
ViceLog(5, ("Ubik: vote 'yes' for %s %s\n",
afs_inet_ntoa_r(otherHost, hoststr),
(astate ? "(in quorum)" : "(NOT in quorum)")));