int verbose = 0;
struct release {
- afs_int32 time;
+ afs_int32 crtime;
+ afs_int32 uptime;
afs_int32 vldbEntryIndex;
};
afs_int32 flags);
static int GetTrans(struct nvldbentry *vldbEntryPtr, afs_int32 index,
struct rx_connection **connPtr, afs_int32 * transPtr,
- afs_int32 * timePtr);
+ afs_int32 * crtimePtr, afs_int32 * uptimePtr);
static int SimulateForwardMultiple(struct rx_connection *fromconn,
afs_int32 fromtid, afs_int32 fromdate,
manyDests * tr, afs_int32 flags,
void *cookie, manyResults * results);
-static int rel_compar(struct release *r1, struct release *r2);
static afs_int32 CheckVolume(volintInfo * volumeinfo, afs_int32 aserver,
afs_int32 apart, afs_int32 * modentry,
afs_uint32 * maxvolid);
static int
GetTrans(struct nvldbentry *vldbEntryPtr, afs_int32 index,
struct rx_connection **connPtr, afs_int32 * transPtr,
- afs_int32 * timePtr)
+ afs_int32 * crtimePtr, afs_int32 * uptimePtr)
{
afs_int32 volid;
struct volser_status tstatus;
int code, rcode, tcode;
*connPtr = (struct rx_connection *)0;
- *timePtr = 0;
*transPtr = 0;
+ *crtimePtr = 0;
+ *uptimePtr = 0;
/* get connection to the replication site */
*connPtr = UV_Bind(vldbEntryPtr->serverNumber[index], AFSCONF_VOLUMEPORT);
code);
goto fail;
}
- *timePtr = tstatus.creationDate - CLOCKSKEW;
+ *crtimePtr = tstatus.creationDate - CLOCKSKEW;
+ *uptimePtr = tstatus.updateDate - CLOCKSKEW;
}
return 0;
}
-static int
-rel_compar(struct release *r1, struct release *r2)
-{
- return (r1->time - r2->time);
-}
-
/* UV_ReleaseVolume()
* Release volume <afromvol> on <afromserver> <afrompart> to all
* its RO sites (full release). Unless the previous release was
manyDests tr;
manyResults results;
int rwindex, roindex, roclone, roexists;
- afs_int32 rwcrdate, clcrdate;
+ afs_int32 rwcrdate, rwupdate, clcrdate;
struct rtime {
int validtime;
- afs_uint32 time;
+ afs_uint32 uptime;
} remembertime[NMAXNSERVERS];
int releasecount = 0;
struct volser_status volstatus;
ONERROR(code, afromvol,
"Failed to get the status of RW volume %u\n");
rwcrdate = volstatus.creationDate;
+ rwupdate = volstatus.updateDate;
/* End transaction on RW */
code = AFSVolEndTrans(fromconn, fromtid, &rcode);
"Failed to get the status of RW clone %u\n");
clcrdate = volstatus.creationDate;
- /* End transaction on RW */
+ /* End transaction on clone */
code = AFSVolEndTrans(fromconn, clonetid, &rcode);
clonetid = 0;
ONERROR((code ? code : rcode), cloneVolId,
- "Failed to end transaction on RW volume %u\n");
+ "Failed to end transaction on RW clone %u\n");
if (rwcrdate > clcrdate)
fullrelease = 2;/* Do a full release if RO clone older than RW */
if (roclone) {
strcpy(vname, entry.name);
strcat(vname, ".readonly");
- VPRINT("Cloning RW volume %u to permanent RO...");
+ VPRINT1("Cloning RW volume %u to permanent RO...", afromvol);
} else {
strcpy(vname, "readonly-clone-temp");
- VPRINT("Cloning RW volume %u to temporary RO...");
+ VPRINT1("Cloning RW volume %u to temporary RO...", afromvol);
}
code =
AFSVolClone(fromconn, clonetid, 0, readonlyVolume, vname,
}
/* Get the time the RW was created for future information */
- VPRINT1("Getting status of RW volume %u...", cloneVolId);
+ VPRINT1("Getting status of RW volume %u...", afromvol);
code = AFSVolGetStatus(fromconn, clonetid, &volstatus);
- ONERROR(code, cloneVolId,
+ ONERROR(code, afromvol,
"Failed to get the status of the RW volume %u\n");
VDONE;
rwcrdate = volstatus.creationDate;
+ rwupdate = volstatus.updateDate;
/* End the transaction on the RW volume */
- VPRINT1("Ending cloning transaction on RW volume %u...", cloneVolId);
+ VPRINT1("Ending cloning transaction on RW volume %u...", afromvol);
code = AFSVolEndTrans(fromconn, clonetid, &rcode);
clonetid = 0;
- ONERROR((code ? code : rcode), cloneVolId,
+ ONERROR((code ? code : rcode), afromvol,
"Failed to end cloning transaction on RW %u\n");
VDONE;
code =
GetTrans(&entry, vldbindex, &(toconns[volcount]),
&(replicas[volcount].trans),
- &(times[volcount].time));
+ &(times[volcount].crtime),
+ &(times[volcount].uptime));
if (code)
continue;
/* Thisdate is the date from which we want to pick up all changes */
if (forceflag || !fullrelease
- || (rwcrdate > times[volcount].time)) {
+ || (rwcrdate > times[volcount].crtime)) {
/* If the forceflag is set, then we want to do a full dump.
* If it's not a full release, we can't be sure that the creation
* date is good (so we also do a full dump).
* case time[volcount].time would be now instead of 0.
*/
thisdate =
- (remembertime[vldbindex].time <
- times[volcount].time) ? remembertime[vldbindex].
- time : times[volcount].time;
+ (remembertime[vldbindex].uptime < times[volcount].uptime)
+ ? remembertime[vldbindex].uptime
+ : times[volcount].uptime;
} else {
- thisdate = times[volcount].time;
+ thisdate = times[volcount].uptime;
}
remembertime[vldbindex].validtime = 1;
- remembertime[vldbindex].time = thisdate;
+ remembertime[vldbindex].uptime = thisdate;
if (volcount == 0) {
fromdate = thisdate;
if (fromdate == 0)
fprintf(STDOUT, " (full release)");
+ else
+ fprintf(STDOUT, " (as of %.24s)", ctime((time_t *)&fromdate));
fprintf(STDOUT, ".\n");
fflush(STDOUT);
}