diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b99e8b4a4a..30b1a48a110 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ Changes by Version next release ------------------- ### Backend Changes +#### Breaking Changes +* Remove deprecated `--badger.truncate` CLI flag in [#3410](https://github.com/jaegertracing/jaeger/pull/3410)) + #### New Features 1.28.0 (2021-11-06) diff --git a/plugin/storage/badger/options.go b/plugin/storage/badger/options.go index 755bc862ed3..0c9845e3cba 100644 --- a/plugin/storage/badger/options.go +++ b/plugin/storage/badger/options.go @@ -44,9 +44,6 @@ type NamespaceConfig struct { ReadOnly bool `mapstructure:"read_only"` } -// TODO deprecated flag to be removed -const truncateWarning = "(deprecated, will be removed after 2021-09-21 or in release v1.26.0, whichever is later)" - const ( defaultMaintenanceInterval time.Duration = 5 * time.Minute defaultMetricsUpdateInterval time.Duration = 10 * time.Second @@ -61,7 +58,6 @@ const ( suffixSyncWrite = ".consistency" suffixMaintenanceInterval = ".maintenance-interval" suffixMetricsInterval = ".metrics-update-interval" // Intended only for testing purposes - suffixTruncate = ".truncate" suffixReadOnly = ".read-only" defaultDataDir = string(os.PathSeparator) + "data" defaultValueDir = defaultDataDir + string(os.PathSeparator) + "values" @@ -136,11 +132,6 @@ func addFlags(flagSet *flag.FlagSet, nsConfig NamespaceConfig) { nsConfig.MetricsUpdateInterval, "How often the badger metrics are collected by Jaeger. Format is time.Duration (https://golang.org/pkg/time/#Duration)", ) - flagSet.Bool( - nsConfig.namespace+suffixTruncate, - false, - truncateWarning+" If write-ahead-log should be truncated on restart. This will cause data loss.", - ) flagSet.Bool( nsConfig.namespace+suffixReadOnly, nsConfig.ReadOnly, @@ -162,9 +153,6 @@ func initFromViper(cfg *NamespaceConfig, v *viper.Viper, logger *zap.Logger) { cfg.MaintenanceInterval = v.GetDuration(cfg.namespace + suffixMaintenanceInterval) cfg.MetricsUpdateInterval = v.GetDuration(cfg.namespace + suffixMetricsInterval) cfg.ReadOnly = v.GetBool(cfg.namespace + suffixReadOnly) - if v.IsSet(cfg.namespace + suffixTruncate) { - logger.Warn("NOTE: Deprecated flag --badger.truncate passed " + truncateWarning) - } } // GetPrimary returns the primary namespace configuration diff --git a/plugin/storage/badger/options_test.go b/plugin/storage/badger/options_test.go index ffe317615d0..32552c49346 100644 --- a/plugin/storage/badger/options_test.go +++ b/plugin/storage/badger/options_test.go @@ -55,14 +55,12 @@ func TestParseOptions(t *testing.T) { assert.False(t, opts.GetPrimary().ReadOnly) } -func TestTruncateAndReadOnlyOptions(t *testing.T) { +func TestReadOnlyOptions(t *testing.T) { opts := NewOptions("badger") v, command := config.Viperize(opts.AddFlags) command.ParseFlags([]string{ - "--badger.truncate=true", "--badger.read-only=true", }) opts.InitFromViper(v, zap.NewNop()) - assert.True(t, opts.GetPrimary().ReadOnly) }