Skip to content

Commit

Permalink
Merge pull request #3736 from influxdb/rp_fail
Browse files Browse the repository at this point in the history
Update shard retention time when policy changes
  • Loading branch information
otoolep committed Aug 19, 2015
2 parents de95a42 + 1fe48d8 commit af4709c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Please see the *Features* section below for full details.
- [#3704](https://github.com/influxdb/influxdb/issues/3704): cluster replication issue for measurement name containing backslash
- [#3681](https://github.com/influxdb/influxdb/issues/3681): Quoted measurement names fail
- [#3681](https://github.com/influxdb/influxdb/issues/3682): Fix inserting string value with backslashes
- [#3736](https://github.com/influxdb/influxdb/pull/3736): Update shard group duration with retention policy changes. Thanks for the report @papylhomme

## v0.9.2 [2015-07-24]

Expand Down
1 change: 1 addition & 0 deletions meta/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ func (data *Data) UpdateRetentionPolicy(database, name string, rpu *RetentionPol
}
if rpu.Duration != nil {
rpi.Duration = *rpu.Duration
rpi.ShardGroupDuration = shardGroupDuration(rpi.Duration)
}
if rpu.ReplicaN != nil {
rpi.ReplicaN = *rpu.ReplicaN
Expand Down
2 changes: 1 addition & 1 deletion meta/data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func TestData_UpdateRetentionPolicy(t *testing.T) {
if rpi, _ := data.RetentionPolicy("db0", "rp1"); !reflect.DeepEqual(rpi, &meta.RetentionPolicyInfo{
Name: "rp1",
Duration: 10 * time.Hour,
ShardGroupDuration: 604800000000000,
ShardGroupDuration: 3600000000000,
ReplicaN: 3,
}) {
t.Fatalf("unexpected policy: %#v", rpi)
Expand Down
2 changes: 1 addition & 1 deletion meta/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ func TestStore_UpdateRetentionPolicy(t *testing.T) {
} else if !reflect.DeepEqual(rpi, &meta.RetentionPolicyInfo{
Name: "rp1",
Duration: 10 * time.Hour,
ShardGroupDuration: 7 * 24 * time.Hour,
ShardGroupDuration: 1 * time.Hour,
ReplicaN: 1,
}) {
t.Fatalf("unexpected policy: %#v", rpi)
Expand Down

0 comments on commit af4709c

Please sign in to comment.