Skip to content

Commit

Permalink
Merge pull request #2838 from influxdb/fix_default_retention
Browse files Browse the repository at this point in the history
Set auto-created retetion period to infinity
  • Loading branch information
otoolep committed Jun 9, 2015
2 parents c1c8c5f + 12ee3af commit e35c391
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
2 changes: 1 addition & 1 deletion cmd/influxd/run/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]]}]}]}`,
},
},
}
Expand Down
2 changes: 2 additions & 0 deletions meta/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const ExecMagic = "EXEC"
const (
AutoCreateRetentionPolicyName = "default"
AutoCreateRetentionPolicyReplicaN = 1
AutoCreateRetentionPolicyPeriod = 0
)

// Raft configuration.
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit e35c391

Please sign in to comment.