=for html
<div class="synopsis">
-B<vos release> S<<< B<-id> <I<volume name or ID>> >>> [B<-force>]
+B<vos release> S<<< B<-id> <I<volume name or ID>> >>>
+ [B<-force>] [B<-force-reclone>]
S<<< [B<-cell> <I<cell name>>] >>>
[B<-noauth>] [B<-localauth>] [B<-stayonline>]
[B<-verbose>] [B<-encrypt>] [B<-noresolve>]
[B<-help>]
B<vos rel> S<<< B<-i> <I<volume name or ID>> >>>
- [B<-f>] S<<< [B<-c> <I<cell name>>] >>> [B<-stayon>]
+ [B<-force>] [B<-force-r>]
+ S<<< [B<-c> <I<cell name>>] >>> [B<-stayon>]
[B<-noa>] [B<-l>] [B<-v>] [B<-e>] [B<-nor>]
S<<< [B<-co> <I<config directory>>] >>>
[B<-h>]
completed successfully and all read-only sites currently have the same
volume. The Volume Server infers that the current B<vos release> 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<Old release> or C<Not released>
flag. As previously noted, the VL Server marks each VLDB site definition
with the C<New release> flag as the site receives the ReleaseClone, and
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
=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<New release>, C<Old release>, or
+C<Not released> 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<New release>, C<Old release>, or
+C<Not released> site flags.
=item B<-stayonline>
#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[]);
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 *),
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)
return E2BIG;
}
- code = UV_ReleaseVolume(avolid, aserver, apart, force, stayUp);
+ code = UV_ReleaseVolume(avolid, aserver, apart, flags);
if (code) {
PrintDiagnostics("release", code);
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");
return code;
}
-/* UV_ReleaseVolume()
- * Release volume <afromvol> on <afromserver> <afrompart> 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 <afromvol> on <afromserver> <afrompart> 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;
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 */
* 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) {
origflags[i] = entry.serverFlags[i];
}
- if (forceflag) {
+ if (flags & REL_COMPLETE) {
complete_release |= CR_FORCED;
}
&& !(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;
}
}
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;