From 442380f8ab84f0a3682b7dd78fa18aad62044894 Mon Sep 17 00:00:00 2001 From: Matt Jaffee Date: Wed, 15 Mar 2017 14:45:43 -0500 Subject: [PATCH] add anti-entropy interval arg --- cmd/server.go | 1 + cmd/server_test.go | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/server.go b/cmd/server.go index 911bdc3e6..cf17e906c 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -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.") diff --git a/cmd/server_test.go b/cmd/server_test.go index b4a1429de..afbefc7af 100644 --- a/cmd/server_test.go +++ b/cmd/server_test.go @@ -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() }, },