add anti-entropy interval arg

This commit is contained in:
Matt Jaffee 2017-03-15 14:45:43 -05:00
parent b291307dde
commit 442380f8ab
2 changed files with 6 additions and 2 deletions

View file

@ -81,6 +81,7 @@ on the configured port.`,
flags.StringSliceVarP(&Serve.Config.Cluster.Nodes, "cluster.hosts", "", []string{}, "Comma separated list of hosts in cluster.")
flags.DurationVarP((*time.Duration)(&Serve.Config.Cluster.PollingInterval), "cluster.poll-interval", "", time.Minute, "Polling interval for cluster.") // TODO what actually is this?
flags.StringVarP(&Serve.Config.Plugins.Path, "plugins.path", "", "", "Path to plugin directory.")
flags.DurationVarP((*time.Duration)(&Serve.Config.AntiEntropy.Interval), "anti-entropy.interval", "", time.Minute*10, "Interval at which to run anti-entropy routine.")
flags.StringVarP(&Serve.CPUProfile, "cpu-profile", "", "", "Where to store CPU profile.")
flags.DurationVarP(&Serve.CPUTime, "cpu-time", "", 30*time.Second, "CPU profile duration.")

View file

@ -75,7 +75,7 @@ bind = "localhost:0"
},
// TEST 1
{
args: []string{"server"},
args: []string{"server", "--anti-entropy.interval", "9m0s"},
env: map[string]string{"PILOSA_CLUSTER.HOSTS": "example.com:1110,example.com:1111"},
cfgFileContent: `
[cluster]
@ -89,6 +89,7 @@ bind = "localhost:0"
v := validator{}
v.Check(cmd.Serve.Config.Cluster.Nodes, []string{"example.com:1110", "example.com:1111"})
v.Check(cmd.Serve.Config.Plugins.Path, "/var/sloth")
v.Check(cmd.Serve.Config.AntiEntropy.Interval, pilosa.Duration(time.Minute*9))
return v.Error()
},
},
@ -102,12 +103,14 @@ bind = "localhost:0"
hosts = [
"localhost:19444",
]
[anti-entropy]
interval = "11m0s"
`,
validation: func() error {
v := validator{}
v.Check(cmd.Serve.Config.Cluster.Nodes, []string{"localhost:19444"})
v.Check(cmd.Serve.Config.Cluster.PollingInterval, pilosa.Duration(time.Minute*2))
v.Check(cmd.Serve.Config.AntiEntropy.Interval, pilosa.Duration(time.Minute*11))
return v.Error()
},
},