From 4b94a0064496002d8837a63da288ccadd91ee792 Mon Sep 17 00:00:00 2001 From: Philip O'Toole Date: Mon, 8 Jun 2015 19:47:37 -0700 Subject: [PATCH 1/2] Set auto-created retetion period to infinity Fix issue #2817 --- cmd/influxd/run/server_test.go | 2 +- meta/store.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/influxd/run/server_test.go b/cmd/influxd/run/server_test.go index a8ecd42827d..e0e7160384d 100644 --- a/cmd/influxd/run/server_test.go +++ b/cmd/influxd/run/server_test.go @@ -150,7 +150,7 @@ func TestServer_DatabaseRetentionPolicyAutoCreate(t *testing.T) { &Query{ name: "show retention policies should return auto-created policy", command: `SHOW RETENTION POLICIES db0`, - exp: `{"results":[{"series":[{"columns":["name","duration","replicaN","default"],"values":[["default","168h0m0s",1,true]]}]}]}`, + exp: `{"results":[{"series":[{"columns":["name","duration","replicaN","default"],"values":[["default","0",1,true]]}]}]}`, }, }, } diff --git a/meta/store.go b/meta/store.go index 6f9950862af..70094471bf0 100644 --- a/meta/store.go +++ b/meta/store.go @@ -37,6 +37,7 @@ const ExecMagic = "EXEC" const ( AutoCreateRetentionPolicyName = "default" AutoCreateRetentionPolicyReplicaN = 1 + AutoCreateRetentionPolicyPeriod = 0 ) // Raft configuration. @@ -578,6 +579,7 @@ func (s *Store) CreateDatabase(name string) (*DatabaseInfo, error) { if s.retentionAutoCreate { rpi := NewRetentionPolicyInfo(AutoCreateRetentionPolicyName) rpi.ReplicaN = AutoCreateRetentionPolicyReplicaN + rpi.Duration = AutoCreateRetentionPolicyPeriod if _, err := s.CreateRetentionPolicy(name, rpi); err != nil { return nil, err } From 12ee3afc7439c231ab488caa3bf20ad0f65f8e50 Mon Sep 17 00:00:00 2001 From: Philip O'Toole Date: Mon, 8 Jun 2015 19:49:08 -0700 Subject: [PATCH 2/2] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc9a8ba7e42..8818ecb06e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - [2816](https://github.com/influxdb/influxdb/pull/2816) -- enable UDP service. Thanks @renan- - [2824](https://github.com/influxdb/influxdb/pull/2824) -- Add missing call to WaitGroup.Done in execConn. Thanks @liyichao - [2823](https://github.com/influxdb/influxdb/pull/2823) -- Convert OpenTSDB to a service. +- [2838](https://github.com/influxdb/influxdb/pull/2838) -- Set auto-created retention policy period to infinite. ## v0.9.0-rc32 [2015-06-07]