From 2dafa9b57b5e58f6d65c502dcb1ded87ae682ce5 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Fri, 10 Sep 2010 15:52:34 -0500 Subject: [PATCH] vos release: Force full dump on RO_DONTUSE sites When releasing a volume, currently we perform an incremental dump on RO_DONTUSE sites if the volume exists on the remote site. Since RO_DONTUSE implies that we do not expect a site to exist there, delete the extant volume if we find one and force a full dump. If we perform an incremental dump, we run the risk of incrementally dumping to a temporary volume that the administrator is not aware of, and doesn't have any actual data but has a last update time late enough that it may be missing some data after the incremental dump. So to avoid that, force a full dump every time. Reviewed-on: http://gerrit.openafs.org/2731 Reviewed-by: Derrick Brashear Tested-by: BuildBot (cherry picked from commit 9fed169b1c5c823fd96cea94daf712b2cf06c901) Change-Id: I2bb301084fa3d2433cd5bf5f8bfde3b1726f2fae Reviewed-on: http://gerrit.openafs.org/3046 Tested-by: Derrick Brashear --- src/volser/vsprocs.c | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/src/volser/vsprocs.c b/src/volser/vsprocs.c index 405a62d52..12b64b097 100644 --- a/src/volser/vsprocs.c +++ b/src/volser/vsprocs.c @@ -3241,12 +3241,51 @@ GetTrans(struct nvldbentry *vldbEntryPtr, afs_int32 index, goto fail; /* server is down */ volid = vldbEntryPtr->volumeId[ROVOL]; - if (volid) + if (volid) { code = AFSVolTransCreate_retry(*connPtr, volid, vldbEntryPtr->serverPartition[index], ITOffline, transPtr); + if (!code && (vldbEntryPtr->serverFlags[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 + * incomplete volume operation. It is difficult to detect if + * that has happened vs if this is a legit volume, so just + * delete it to be safe. */ + + VPRINT1("Deleting extant RO_DONTUSE site on %s...", + noresolve ? afs_inet_ntoa_r(vldbEntryPtr-> + serverNumber[index], hoststr) : + hostutil_GetNameByINet(vldbEntryPtr-> + serverNumber[index])); + + code = AFSVolDeleteVolume(*connPtr, *transPtr); + if (code) { + PrintError("Failed to delete RO_DONTUSE site: ", code); + goto fail; + } + + tcode = AFSVolEndTrans(*connPtr, *transPtr, &rcode); + *transPtr = 0; + if (!tcode) { + tcode = rcode; + } + if (tcode) { + PrintError("Failed to end transaction on RO_DONTUSE site: ", + tcode); + goto fail; + } + + VDONE; + + /* emulate what TransCreate would have returned, so we try to + * create the volume below */ + code = VNOVOL; + } + } + /* If the volume does not exist, create it */ if (!volid || code) { char volname[64]; -- 2.39.5