Merge pull request #4737 from ch33hau/4283-hh-throws-error-even-if-disabled
Disable HintedHandoff if configuration is not set. #4283pull/4703/head
commit
6ecb62e4d2
|
@ -111,6 +111,7 @@
|
|||
- [#4602](https://github.com/influxdb/influxdb/issues/4602): Fixes data race between PointsWriter and Subscriber services.
|
||||
- [#4691](https://github.com/influxdb/influxdb/issues/4691): Enable toml test `TestConfig_Encode`.
|
||||
- [#4684](https://github.com/influxdb/influxdb/pull/4684): Add Graphite and UDP section to default config. Thanks @nkatsaros
|
||||
- [#4283](https://github.com/influxdb/influxdb/pull/4283): Disable HintedHandoff if configuration is not set.
|
||||
|
||||
## v0.9.4 [2015-09-14]
|
||||
|
||||
|
|
|
@ -101,6 +101,7 @@ func NewDemoConfig() (*Config, error) {
|
|||
c.HintedHandoff.Dir = filepath.Join(homeDir, ".influxdb/hh")
|
||||
c.Data.WALDir = filepath.Join(homeDir, ".influxdb/wal")
|
||||
|
||||
c.HintedHandoff.Enabled = true
|
||||
c.Admin.Enabled = true
|
||||
|
||||
return c, nil
|
||||
|
@ -110,7 +111,7 @@ func NewDemoConfig() (*Config, error) {
|
|||
func (c *Config) Validate() error {
|
||||
if c.Meta.Dir == "" {
|
||||
return errors.New("Meta.Dir must be specified")
|
||||
} else if c.HintedHandoff.Dir == "" {
|
||||
} else if c.HintedHandoff.Enabled && c.HintedHandoff.Dir == "" {
|
||||
return errors.New("HintedHandoff.Dir must be specified")
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ type Config struct {
|
|||
|
||||
func NewConfig() Config {
|
||||
return Config{
|
||||
Enabled: true,
|
||||
Enabled: false,
|
||||
MaxSize: DefaultMaxSize,
|
||||
MaxAge: toml.Duration(DefaultMaxAge),
|
||||
RetryRateLimit: DefaultRetryRateLimit,
|
||||
|
|
|
@ -53,3 +53,21 @@ purge-interval = "1h"
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
func TestDefaultDisabled(t *testing.T) {
|
||||
// Parse empty configuration.
|
||||
var c hh.Config
|
||||
if _, err := toml.Decode(``, &c); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if exp := false; c.Enabled == true {
|
||||
t.Fatalf("unexpected default Enabled value: got %v, exp %v", c.Enabled, exp)
|
||||
}
|
||||
|
||||
// Default configuration.
|
||||
c = hh.NewConfig()
|
||||
if exp := false; c.Enabled == true {
|
||||
t.Fatalf("unexpected default enabled value: got %v, exp %v", c.Enabled, exp)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue