volser: preserve volume stats by default 74/12674/4
authorMichael Meffie <mmeffie@sinenomine.net>
Tue, 1 Aug 2017 21:21:13 +0000 (17:21 -0400)
committerBenjamin Kaduk <kaduk@mit.edu>
Thu, 3 Aug 2017 00:28:23 +0000 (20:28 -0400)
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 <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

doc/man-pages/pod8/fragments/volserver-options.pod
doc/man-pages/pod8/fragments/volserver-synopsis.pod
src/volser/volmain.c

index f3d964c..87e5aae 100644 (file)
@@ -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> <I<sync behavior>>
 
index bc85a7b..53655b6 100644 (file)
@@ -5,9 +5,9 @@ B<volserver>
     S<<< [B<-logfile <I<log file>>] >>> S<<< [B<-config> <I<configuration path>>] >>>
     S<<< [B<-udpsize> <I<size of socket buffer in bytes>>] >>>
     S<<< [B<-d> <I<debug level>>] >>>
-    [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> <I<sync behavior>>]
     [B<-rxmaxmtu> <I<bytes>>]
     [B<-rxbind>]
index e4df19d..430510f 100644 (file)
@@ -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))