diff --git a/plugin/storage/badger/factory.go b/plugin/storage/badger/factory.go index 5572ffec72b5..d4564742c647 100644 --- a/plugin/storage/badger/factory.go +++ b/plugin/storage/badger/factory.go @@ -91,6 +91,8 @@ func (f *Factory) Initialize(metricsFactory metrics.Factory, logger *zap.Logger) opts := badger.DefaultOptions opts.TableLoadingMode = options.MemoryMap + // This is important. Without this Badger would keep atleast 1 version of very key. + opts.NumVersionsToKeep = 0 if f.Options.primary.Ephemeral { opts.SyncWrites = false