From: Michael Meffie Date: Tue, 1 Aug 2017 21:21:13 +0000 (-0400) Subject: volser: preserve volume stats by default X-Git-Tag: BP-openafs-stable-1_8_x~12 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=8e1ca72b1cbed930d3661dee5cb742cab52737e9 volser: preserve volume stats by default Commit dfceff1d3a66e76246537738720f411330808d64 added the -preserve-vol-stats flag to the volume server. This enabled a change in the volume server to preserve volume usage statistics during reclone and restore operations. Otherwise, volume usage counters of read-only volumes are cleared when volumes are released, making it difficult to track usage with the volume stats. Make this feature the default behavior of the volume server and provide the option -clear-vol-stats to use the old behavior if so desired. This change makes the -preserve-vol-stats the default, and keeps it as a hidden flag for sites which may already have that flag set in the BosConfig. Since this changes a default behavior of the volume server, this change is only appropriate on a major or minor release boundary, not in the middle of a stable series. Change-Id: I3706ede64b7b18a80b39ebd55f2e1824bb7dbc57 Reviewed-on: https://gerrit.openafs.org/12674 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk --- diff --git a/doc/man-pages/pod8/fragments/volserver-options.pod b/doc/man-pages/pod8/fragments/volserver-options.pod index f3d964c..87e5aae 100644 --- a/doc/man-pages/pod8/fragments/volserver-options.pod +++ b/doc/man-pages/pod8/fragments/volserver-options.pod @@ -80,11 +80,15 @@ user.admin PTS entry. Sites whose Kerberos realms don't have these collisions between principal names may disable this check by starting the server with this option. -=item B<-preserve-vol-stats> +=item B<-clear-vol-stats> -Preserve volume access statistics over volume restore and reclone operations. -By default, volume access statistics are reset during volume restore and reclone -operations. +Clear volume access statistics during volume restore and reclone operations. +This includes clearing the volume access statistics of read-only volumes during +a volume release. By default, volume access statistics are preserved during +volume restore and reclone operations. + +Volume access statistics were cleared by default in versions prior to OpenAFS +1.8.0. This flag is intended to provide compatible behaviour. =item B<-sync> > diff --git a/doc/man-pages/pod8/fragments/volserver-synopsis.pod b/doc/man-pages/pod8/fragments/volserver-synopsis.pod index bc85a7b..53655b6 100644 --- a/doc/man-pages/pod8/fragments/volserver-synopsis.pod +++ b/doc/man-pages/pod8/fragments/volserver-synopsis.pod @@ -5,9 +5,9 @@ B S<<< [B<-logfile >] >>> S<<< [B<-config> >] >>> S<<< [B<-udpsize> >] >>> S<<< [B<-d> >] >>> - [B<-nojumbo>] [B<-jumbo>] - [B<-enable_peer_stats>] [B<-enable_process_stats>] - [B<-allow-dotted-principals>] [B<-preserve-vol-stats>] + [B<-nojumbo>] [B<-jumbo>] + [B<-enable_peer_stats>] [B<-enable_process_stats>] + [B<-allow-dotted-principals>] [B<-clear-vol-stats>] [B<-sync> >] [B<-rxmaxmtu> >] [B<-rxbind>] diff --git a/src/volser/volmain.c b/src/volser/volmain.c index e4df19d..430510f 100644 --- a/src/volser/volmain.c +++ b/src/volser/volmain.c @@ -76,7 +76,7 @@ int restrictedQueryLevel = RESTRICTED_QUERY_ANYUSER; int rxBind = 0; int rxkadDisableDotCheck = 0; -int DoPreserveVolumeStats = 0; +int DoPreserveVolumeStats = 1; int rxJumbograms = 0; /* default is to not send and receive jumbograms. */ int rxMaxMTU = -1; char *auditFileName = NULL; @@ -237,6 +237,7 @@ enum optionsList { OPT_peer, OPT_process, OPT_preserve_vol_stats, + OPT_clear_vol_stats, OPT_sync, #ifdef HAVE_SYSLOG OPT_syslog, @@ -288,8 +289,12 @@ ParseArgs(int argc, char **argv) { CMD_OPTIONAL, "enable RX transport statistics"); cmd_AddParmAtOffset(opts, OPT_process, "-enable_process_stats", CMD_FLAG, CMD_OPTIONAL, "enable RX RPC statistics"); + /* -preserve-vol-stats on by default now. */ cmd_AddParmAtOffset(opts, OPT_preserve_vol_stats, "-preserve-vol-stats", CMD_FLAG, - CMD_OPTIONAL, "preserve volume statistics"); + CMD_OPTIONAL|CMD_HIDDEN, + "preserve volume statistics when restoring/recloning"); + cmd_AddParmAtOffset(opts, OPT_clear_vol_stats, "-clear-vol-stats", CMD_FLAG, + CMD_OPTIONAL, "clear volume statistics when restoring/recloning"); #ifdef HAVE_SYSLOG cmd_AddParmAtOffset(opts, OPT_syslog, "-syslog", CMD_SINGLE_OR_FLAG, CMD_OPTIONAL, "log to syslog"); @@ -317,7 +322,8 @@ ParseArgs(int argc, char **argv) { cmd_OptionAsFlag(opts, OPT_log, &DoLogging); cmd_OptionAsFlag(opts, OPT_rxbind, &rxBind); cmd_OptionAsFlag(opts, OPT_dotted, &rxkadDisableDotCheck); - cmd_OptionAsFlag(opts, OPT_preserve_vol_stats, &DoPreserveVolumeStats); + if (cmd_OptionPresent(opts, OPT_clear_vol_stats)) + DoPreserveVolumeStats = 0; if (cmd_OptionPresent(opts, OPT_peer)) rx_enablePeerRPCStats(); if (cmd_OptionPresent(opts, OPT_process))