Skip to content

Commit

Permalink
[dbnode] Add ability to force enable cold writes from config (#3002)
Browse files Browse the repository at this point in the history
  • Loading branch information
robskillington authored Dec 11, 2020
1 parent b5a22ba commit 19fdb08
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cmd/services/m3dbnode/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions src/cmd/services/m3dbnode/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,7 @@ func TestConfiguration(t *testing.T) {
debug:
mutexProfileFraction: 0
blockProfileRate: 0
forceColdWritesEnabled: null
coordinator: null
`

Expand Down
5 changes: 5 additions & 0 deletions src/dbnode/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 19fdb08

Please sign in to comment.