Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update shard retention time when policy changes #3736

Merged
merged 2 commits into from
Aug 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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