- Config loading will now fail if the KeepServiceList config option is provided with any value other than "disk", which is equal to the new behavior.
- Changes default BalanceCollectionBatch config to zero.
Arvados-DCO-1.1-Signed-off-by: Eric Biagiotti <ebiagiotti@veritasgenetics.com>
# The default is 2 weeks.
BlobSigningTTL: 336h
- # When running keep-balance, this is the destination filename for the
- # list of lost block hashes if there are any, one per line. Updated atomically during
- # each successful run.
+ # When running keep-balance, this is the destination filename for
+ # the list of lost block hashes if there are any, one per line.
+ # Updated automically during each successful run.
BlobMissingReport: ""
# keep-balance operates periodically, i.e.: do a
# API transaction. If this is zero, page size is
# determined by the API server's own page size limits (see
# API.MaxItemsPerResponse and API.MaxIndexDatabaseRead).
- BalanceCollectionBatch: 100000
+ BalanceCollectionBatch: 0
# The size of keep-balance's internal queue of
# collections. Higher values use more memory and improve throughput
cluster.API.KeepServiceRequestTimeout = *oc.RequestTimeout
}
- msg := "To balance specfic keep services, please update to the cluster config."
- if oc.KeepServiceTypes != nil && len(*oc.KeepServiceTypes) > 0 {
- ldr.Logger.Warnf("The KeepServiceType configuration option is not longer supported and is being ignored. %s", msg)
+ msg := "The %s configuration option is no longer supported. Please remove it from your configuration file. Keep-balance will operate on all configured volumes."
+
+ // If the keep service type provided is "disk" silently ignore it, since
+ // this is what ends up being done anyway.
+ if oc.KeepServiceTypes != nil {
+ numTypes := len(*oc.KeepServiceTypes)
+ if numTypes != 0 && !(numTypes == 1 && (*oc.KeepServiceTypes)[0] == "disk") {
+ return fmt.Errorf(msg, "KeepServiceType")
+ }
}
+
if oc.KeepServiceList != nil {
- return fmt.Errorf("The KeepServiceList configuration option is no longer supported. Please remove it from your configuration file. %s", msg)
+ return fmt.Errorf(msg, "KeepServiceList")
}
cfg.Clusters[cluster.ClusterID] = *cluster
_, err = testLoadLegacyConfig(content, f, c)
c.Check(err, check.IsNil)
+ content = []byte(fmtKeepBalanceConfig(`"KeepServiceTypes":[],`))
+ _, err = testLoadLegacyConfig(content, f, c)
+ c.Check(err, check.IsNil)
+
+ content = []byte(fmtKeepBalanceConfig(`"KeepServiceTypes":["proxy"],`))
+ _, err = testLoadLegacyConfig(content, f, c)
+ c.Check(err, check.NotNil)
+
+ content = []byte(fmtKeepBalanceConfig(`"KeepServiceTypes":["disk", "proxy"],`))
+ _, err = testLoadLegacyConfig(content, f, c)
+ c.Check(err, check.NotNil)
+
content = []byte(fmtKeepBalanceConfig(`"KeepServiceList":{},`))
_, err = testLoadLegacyConfig(content, f, c)
c.Check(err, check.NotNil)
# The default is 2 weeks.
BlobSigningTTL: 336h
- # When running keep-balance, this is the destination filename for the
- # list of lost block hashes if there are any, one per line. Updated atomically during
- # each successful run.
+ # When running keep-balance, this is the destination filename for
+ # the list of lost block hashes if there are any, one per line.
+ # Updated automically during each successful run.
BlobMissingReport: ""
# keep-balance operates periodically, i.e.: do a
# API transaction. If this is zero, page size is
# determined by the API server's own page size limits (see
# API.MaxItemsPerResponse and API.MaxIndexDatabaseRead).
- BalanceCollectionBatch: 100000
+ BalanceCollectionBatch: 0
# The size of keep-balance's internal queue of
# collections. Higher values use more memory and improve throughput
func newHandler(ctx context.Context, cluster *arvados.Cluster, token string, registry *prometheus.Registry) service.Handler {
if !options.Once && cluster.Collections.BalancePeriod == arvados.Duration(0) {
- return service.ErrorHandler(ctx, cluster, fmt.Errorf("You must either run keep-balance with the -once flag, or set Collections.BalancePeriod in the config. "+
+ return service.ErrorHandler(ctx, cluster, fmt.Errorf("cannot start service: Collections.BalancePeriod is zero (if you want to run once and then exit, use the -once flag)"))
"If using the legacy keep-balance.yml config, RunPeriod is the equivalant of Collections.BalancePeriod."))
}