From: Michael Meffie Date: Fri, 1 Feb 2013 22:46:45 +0000 (-0500) Subject: vos: vos release -force-reclone option X-Git-Tag: upstream/1.8.0_pre1^2~704 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=995cc38a24840cd1ba2b8dcdf3c9df233c1b2abe;p=packages%2Fo%2Fopenafs.git vos: vos release -force-reclone option Add a new vos release option called -force-reclone to force the reclone of the release clone and a release to all of the remote sites, regardless of the state of the VLDB flags on the remote sites, but does not force full volume dumps when distributing the volume. Provide an alias -f for -force for compatibility with the original IBM vos, in case scripts were written to use the old '-f' option, and for users with muscle memory. Change-Id: I0ebebc5e8099299781e8da57579d91848bb2ad19 Reviewed-on: http://gerrit.openafs.org/9020 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk Reviewed-by: Jeffrey Altman Reviewed-by: D Brashear --- diff --git a/doc/man-pages/pod1/vos_release.pod.in b/doc/man-pages/pod1/vos_release.pod.in index 9aff1b81f..6e64a1b18 100644 --- a/doc/man-pages/pod1/vos_release.pod.in +++ b/doc/man-pages/pod1/vos_release.pod.in @@ -7,7 +7,8 @@ vos_release - Updates read-only volumes to match the read/write source volume =for html
-B S<<< B<-id> > >>> [B<-force>] +B S<<< B<-id> > >>> + [B<-force>] [B<-force-reclone>] S<<< [B<-cell> >] >>> [B<-noauth>] [B<-localauth>] [B<-stayonline>] [B<-verbose>] [B<-encrypt>] [B<-noresolve>] @@ -15,7 +16,8 @@ B S<<< B<-id> > >>> [B<-force>] [B<-help>] B S<<< B<-i> > >>> - [B<-f>] S<<< [B<-c> >] >>> [B<-stayon>] + [B<-force>] [B<-force-r>] + S<<< [B<-c> >] >>> [B<-stayon>] [B<-noa>] [B<-l>] [B<-v>] [B<-e>] [B<-nor>] S<<< [B<-co> >] >>> [B<-h>] @@ -107,15 +109,19 @@ on site definitions in the VLDB entry, the previous B command completed successfully and all read-only sites currently have the same volume. The Volume Server infers that the current B command was issued because the read/write volume has changed. The Volume Server -creates a new ReleaseClone and distributes it to all of the read-only -sites. +creates a new ReleaseClone volume and distributes a copy of the clone +volume to all the read-only sites. In order to reduce the amount of data +transferred during a release, the Volume Server sends incremental changes to +remote sites during the release. The Volume Server only sends files and +directories which have been changed in the read/write volume since the +previous release. =item * If any site definition in the VLDB entry is marked with a flag, either the previous release operation did not complete successfully or a new read-only site was defined since the last release. The Volume Server does -not create a new ReleaseClone, instead distributing the existing +not create a new ReleaseClone, instead distributing the entire existing ReleaseClone to sites marked with the C or C flag. As previously noted, the VL Server marks each VLDB site definition with the C flag as the site receives the ReleaseClone, and @@ -129,6 +135,10 @@ flag. This is appropriate if, for example, the data at the read/write site has changed since the existing ReleaseClone was created during the previous release operation. +The B<-force-reclone> will force the creation of a new release clone volume, +but will not force a full volume dump to be distributed to the remote sites. +Instead, incremental changes will be distributed when possible. + =head1 OPTIONS =over 4 @@ -140,9 +150,15 @@ volume. =item B<-force> -Creates a new ReleaseClone and distributes it all read-only sites -regardless of whether or not any site definitions in the VLDB entry are -marked with a flag. +Creates a new ReleaseClone and distributes the entire clone volume to +all read-only sites, regardless of the C, C, or +C site flags. + +=item B<-force-reclone> + +Creates a new ReleaseClone and incrementally distributes the clone volume to +all read-only sites, regardless of the C, C, or +C site flags. =item B<-stayonline> diff --git a/src/volser/volser.p.h b/src/volser/volser.p.h index 9f7b9409a..899c824f0 100644 --- a/src/volser/volser.p.h +++ b/src/volser/volser.p.h @@ -185,6 +185,11 @@ struct partList { /*used by the backup system */ #define RV_NODEL 0x100000 #define RV_RWONLY 0x200000 +/* Values for the UV_ReleaseVolume flags parameters */ +#define REL_COMPLETE 0x000001 /* force a complete release */ +#define REL_FULLDUMPS 0x000002 /* force full dumps */ +#define REL_STAYUP 0x000004 /* dump to clones to avoid offline time */ + struct ubik_client; extern afs_uint32 vsu_GetVolumeID(char *astring, struct ubik_client *acstruct, afs_int32 *errp); extern int vsu_ExtractName(char rname[], char name[]); diff --git a/src/volser/volser_internal.h b/src/volser/volser_internal.h index adf48e124..0695a64e1 100644 --- a/src/volser/volser_internal.h +++ b/src/volser/volser_internal.h @@ -61,7 +61,7 @@ extern int UV_MoveVolume2(afs_uint32 afromvol, afs_uint32 afromserver, extern int UV_BackupVolume(afs_uint32 aserver, afs_int32 apart, afs_uint32 avolid); extern int UV_ReleaseVolume(afs_uint32 afromvol, afs_uint32 afromserver, - afs_int32 afrompart, int forceflag, int upflag); + afs_int32 afrompart, int flags); extern int UV_DumpVolume(afs_uint32 afromvol, afs_uint32 afromserver, afs_int32 afrompart, afs_int32 fromdate, afs_int32(*DumpFunction) (struct rx_call *, void *), diff --git a/src/volser/vos.c b/src/volser/vos.c index 95df17b52..d89b076f5 100644 --- a/src/volser/vos.c +++ b/src/volser/vos.c @@ -2870,13 +2870,15 @@ ReleaseVolume(struct cmd_syndesc *as, void *arock) afs_uint32 avolid; afs_uint32 aserver; afs_int32 apart, vtype, code, err; - int force = 0; - int stayUp = 0; + int flags = 0; + + if (as->parms[1].items) /* -force */ + flags |= (REL_COMPLETE | REL_FULLDUMPS); + if (as->parms[2].items) /* -stayonline */ + flags |= REL_STAYUP; + if (as->parms[3].items) /* -force-reclone */ + flags |= REL_COMPLETE; - if (as->parms[1].items) - force = 1; - if (as->parms[2].items) - stayUp = 1; avolid = vsu_GetVolumeID(as->parms[0].items->data, cstruct, &err); if (avolid == 0) { if (err) @@ -2902,7 +2904,7 @@ ReleaseVolume(struct cmd_syndesc *as, void *arock) return E2BIG; } - code = UV_ReleaseVolume(avolid, aserver, apart, force, stayUp); + code = UV_ReleaseVolume(avolid, aserver, apart, flags); if (code) { PrintDiagnostics("release", code); @@ -5982,9 +5984,12 @@ main(int argc, char **argv) ts = cmd_CreateSyntax("release", ReleaseVolume, NULL, "release a volume"); cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID"); cmd_AddParm(ts, "-force", CMD_FLAG, CMD_OPTIONAL, - "force a complete release"); + "force a complete release and full dumps"); + cmd_AddParmAlias(ts, 1, "-f"); /* original force option */ cmd_AddParm(ts, "-stayonline", CMD_FLAG, CMD_OPTIONAL, "release to cloned temp vol, then clone back to repsite RO"); + cmd_AddParm(ts, "-force-reclone", CMD_FLAG, CMD_OPTIONAL, + "force a reclone and complete release with incremental dumps"); COMMONPARMS; ts = cmd_CreateSyntax("dump", DumpVolumeCmd, NULL, "dump a volume"); diff --git a/src/volser/vsprocs.c b/src/volser/vsprocs.c index 39d51fbd6..18d47f3e3 100644 --- a/src/volser/vsprocs.c +++ b/src/volser/vsprocs.c @@ -3449,23 +3449,31 @@ DoVolOnline(struct nvldbentry *vldbEntryPtr, afs_uint32 avolid, int index, return code; } -/* UV_ReleaseVolume() - * Release volume on to all - * its RO sites (full release). Unless the previous release was - * incomplete: in which case we bring the remaining incomplete - * volumes up to date with the volumes that were released - * successfully. - * forceflag: Performs a full release. +/** + * Release a volume to read-only sites + * + * Release volume on to all + * its RO sites (full release). Unless the previous release was + * incomplete: in which case we bring the remaining incomplete + * volumes up to date with the volumes that were released + * successfully. * - * Will create a clone from the RW, then dump the clone out to - * the remaining replicas. If there is more than 1 RO sites, - * ensure that the VLDB says at least one RO is available all - * the time: Influences when we write back the VLDB entry. + * Will create a clone from the RW, then dump the clone out to + * the remaining replicas. If there is more than 1 RO sites, + * ensure that the VLDB says at least one RO is available all + * the time: Influences when we write back the VLDB entry. + * + * @param[in] afromvol volume to be released + * @param[in] afromserver server containing afromvol + * @param[in] afrompart partition containing afromvol + * @param[in] flags bitmap of options + * REL_COMPLETE - force a complete release + * REL_FULLDUMPS - force full dumps + * REL_STAYUP - dump to clones to avoid offline time */ - int UV_ReleaseVolume(afs_uint32 afromvol, afs_uint32 afromserver, - afs_int32 afrompart, int forceflag, int stayUp) + afs_int32 afrompart, int flags) { char vname[64]; afs_int32 code = 0; @@ -3507,6 +3515,7 @@ UV_ReleaseVolume(afs_uint32 afromvol, afs_uint32 afromserver, int justnewsites = 0; /* are we just trying to release to new RO sites? */ int sites = 0; /* number of ro sites */ int new_sites = 0; /* number of ro sites markes as new */ + int stayUp = (flags & REL_STAYUP); typedef enum { CR_RECOVER = 0x0000, /**< not complete: a recovery from a previous failed release */ @@ -3582,7 +3591,7 @@ UV_ReleaseVolume(afs_uint32 afromvol, afs_uint32 afromserver, * vldb flags. * * The caller can override the vldb flags check using the -force - * flag, to force this to be a complete release. + * or -force-reclone flag, to force this to be a complete release. */ for (i = 0; i < entry.nServers; i++) { if (entry.serverFlags[i] & ITSROVOL) { @@ -3595,7 +3604,7 @@ UV_ReleaseVolume(afs_uint32 afromvol, afs_uint32 afromserver, origflags[i] = entry.serverFlags[i]; } - if (forceflag) { + if (flags & REL_COMPLETE) { complete_release |= CR_FORCED; } @@ -3609,7 +3618,8 @@ UV_ReleaseVolume(afs_uint32 afromvol, afs_uint32 afromserver, && !(complete_release & CR_FORCED)) { if (notreleased && notreleased != sites) { /* we have some new unreleased sites. try to just release to those, - * if the RW has not changed. The caller can override with -force. */ + * if the RW has not changed. The caller can override with -force + * or with -force-reclone. */ justnewsites = 1; } } @@ -4067,7 +4077,7 @@ UV_ReleaseVolume(afs_uint32 afromvol, afs_uint32 afromserver, continue; /* Thisdate is the date from which we want to pick up all changes */ - if (forceflag) { + if (flags & REL_FULLDUMPS) { /* Do a full dump when forced by the caller. */ VPRINT("This will be a full dump: forced\n"); thisdate = 0;