From 2f79412004299a33ae933c4e772b02a312c56ebd Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Thu, 25 Nov 2021 15:05:34 -0500 Subject: [PATCH 1/2] Remove deprecated `--badger.truncate` CLI flag Signed-off-by: Yuri Shkuro --- CHANGELOG.md | 3 +++ plugin/storage/badger/options.go | 12 ------------ plugin/storage/badger/options_test.go | 4 +--- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b99e8b4a4a..60055994dc1 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 + #### 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) } From 956b5b40f0675151bb25b8d55b1979fd70bdbdcc Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Thu, 25 Nov 2021 15:06:41 -0500 Subject: [PATCH 2/2] prnum Signed-off-by: Yuri Shkuro --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60055994dc1..30b1a48a110 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ next release ------------------- ### Backend Changes #### Breaking Changes -- Remove deprecated `--badger.truncate` CLI flag +* Remove deprecated `--badger.truncate` CLI flag in [#3410](https://github.com/jaegertracing/jaeger/pull/3410)) #### New Features