From 79678407c53070f488abafbd8a724b10b05ddb4b Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Thu, 11 Nov 2010 14:45:04 -0600 Subject: [PATCH] vos release: Avoid full dump on all sites Commit 9fed169b1c5c823fd96cea94daf712b2cf06c901 attempts to remove any remote RO site that has RO_DONTUSE set. However, we set RO_DONTUSE on all sites earlier in the release process if this is a full release, resulting in all sites getting a full dump. Correct this by remembering in 'origflags' what flags each site has before we messed with the vldb entry. Thanks to Mike Meffie. Reviewed-on: http://gerrit.openafs.org/3296 Reviewed-by: Derrick Brashear Tested-by: BuildBot Reviewed-by: Michael Meffie Tested-by: Michael Meffie (cherry picked from commit 97474963e58253f8c891e9f6596403213d53527b) Change-Id: I5a14c490dba7e1ad815856ccb3f90e210e09f50d Reviewed-on: http://gerrit.openafs.org/3624 Reviewed-by: Derrick Brashear Tested-by: BuildBot --- src/volser/vsprocs.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/volser/vsprocs.c b/src/volser/vsprocs.c index 601497361..66dc4cd62 100644 --- a/src/volser/vsprocs.c +++ b/src/volser/vsprocs.c @@ -176,7 +176,8 @@ static int DelVol(struct rx_connection *conn, afs_uint32 vid, afs_int32 part, afs_int32 flags); static int GetTrans(struct uvldbentry *vldbEntryPtr, afs_int32 index, struct rx_connection **connPtr, afs_int32 * transPtr, - afs_uint32 * crtimePtr, afs_uint32 * uptimePtr); + afs_uint32 * crtimePtr, afs_uint32 * uptimePtr, + afs_int32 *origflags); static int SimulateForwardMultiple(struct rx_connection *fromconn, afs_int32 fromtid, afs_int32 fromdate, manyDests * tr, afs_int32 flags, @@ -3314,7 +3315,8 @@ DelVol(struct rx_connection *conn, afs_uint32 vid, afs_int32 part, static int GetTrans(struct uvldbentry *vldbEntryPtr, afs_int32 index, struct rx_connection **connPtr, afs_int32 * transPtr, - afs_uint32 * crtimePtr, afs_uint32 * uptimePtr) + afs_uint32 * crtimePtr, afs_uint32 * uptimePtr, + afs_int32 *origflags) { afs_uint32 volid; struct volser_status tstatus; @@ -3339,7 +3341,7 @@ GetTrans(struct uvldbentry *vldbEntryPtr, afs_int32 index, vldbEntryPtr->serverPartition[index], ITOffline, transPtr); - if (!code && (vldbEntryPtr->serverFlags[index] & RO_DONTUSE)) { + if (!code && (origflags[index] & RO_DONTUSE)) { /* If RO_DONTUSE is set, this is supposed to be an entirely new * site. Don't trust any data on it, since it is possible we * have encountered some temporary volume from some other @@ -3528,9 +3530,11 @@ UV_ReleaseVolume(afs_uint32 afromvol, afs_uint32 afromserver, int releasecount = 0; struct volser_status volstatus; char hoststr[16]; + afs_int32 origflags[NMAXNSERVERS]; memset(remembertime, 0, sizeof(remembertime)); memset(&results, 0, sizeof(results)); + memset(origflags, 0, sizeof(origflags)); vcode = ubik_VL_SetLock(cstruct, 0, afromvol, RWVOL, VLOP_RELEASE); if (vcode != VL_RERELEASE) @@ -3589,6 +3593,7 @@ UV_ReleaseVolume(afs_uint32 afromvol, afs_uint32 afromserver, m++; if (entry.serverFlags[i] & NEW_REPSITE) s++; } + origflags[i] = entry.serverFlags[i]; } if ((forceflag && !fullrelease) || (s == m) || (s == 0)) fullrelease = 1; @@ -3876,7 +3881,8 @@ UV_ReleaseVolume(afs_uint32 afromvol, afs_uint32 afromserver, GetTrans(&entry, vldbindex, &(toconns[volcount]), &(replicas[volcount].trans), &(times[volcount].crtime), - &(times[volcount].uptime)); + &(times[volcount].uptime), + origflags); if (code) continue; -- 2.39.5