diff --git a/src/cmd/services/m3dbnode/config/config.go b/src/cmd/services/m3dbnode/config/config.go index b1b3b8332d..bf3f62569e 100644 --- a/src/cmd/services/m3dbnode/config/config.go +++ b/src/cmd/services/m3dbnode/config/config.go @@ -207,6 +207,10 @@ type DBConfiguration struct { // Debug configuration. Debug config.DebugConfiguration `yaml:"debug"` + + // ForceColdWritesEnabled will force enable cold writes for all namespaces + // if set. + ForceColdWritesEnabled *bool `yaml:"forceColdWritesEnabled"` } // LoggingOrDefault returns the logging configuration or defaults. diff --git a/src/cmd/services/m3dbnode/config/config_test.go b/src/cmd/services/m3dbnode/config/config_test.go index 5beeb0a5e7..8218580a33 100644 --- a/src/cmd/services/m3dbnode/config/config_test.go +++ b/src/cmd/services/m3dbnode/config/config_test.go @@ -729,6 +729,7 @@ func TestConfiguration(t *testing.T) { debug: mutexProfileFraction: 0 blockProfileRate: 0 + forceColdWritesEnabled: null coordinator: null ` diff --git a/src/dbnode/server/server.go b/src/dbnode/server/server.go index 52df3307c7..ef21426ef7 100644 --- a/src/dbnode/server/server.go +++ b/src/dbnode/server/server.go @@ -651,6 +651,11 @@ func Run(runOpts RunOptions) { }() opts = opts.SetIndexClaimsManager(icm) + if value := cfg.ForceColdWritesEnabled; value != nil { + // Allow forcing cold writes to be enabled by config. + opts = opts.SetForceColdWritesEnabled(*value) + } + forceColdWrites := opts.ForceColdWritesEnabled() var envCfgResults environment.ConfigureResults if len(envConfig.Statics) == 0 {