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

fix: Migrated bucket should have correct retention policy. #17769

Merged
merged 2 commits into from
Apr 20, 2020

Conversation

patriczek
Copy link
Contributor

@patriczek patriczek commented Apr 16, 2020

This commit fixed that, if is created bucket while migration and the old database had set retention policy, than this policy is used in created bucket.

Closes #17257

Signed-off-by: Patrik Helia patashelia@gmail.com

Signed-off-by: Patrik Helia <patashelia@gmail.com>
@patriczek patriczek marked this pull request as ready for review April 16, 2020 19:38
@8none1 8none1 requested a review from benbjohnson April 17, 2020 07:59
Copy link
Contributor

@benbjohnson benbjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Looks great. One minor stylistic change requested. Also, can you run go fmt so the CI linter passes?

$ go fmt tsdb/migrate/data_v1.go

Comment on lines 306 to 318
f, err := os.Open(file)
if err != nil {
if os.IsNotExist(err) {
return nil, err
}
return nil, err
}
defer f.Close()

data, err := ioutil.ReadAll(f)
if err != nil {
return nil, err
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can all be shortened to:

data, err := ioutil.ReadFile(file)
if err != nil {
	return nil, err
}

Also, your check for os.IsNotExist(err) on L308 is redundant since both error cases simply return err.

Signed-off-by: Patrik Helia <patrik.helia@kiwi.com>
@benbjohnson benbjohnson merged commit 69fe9ed into influxdata:master Apr 20, 2020
@benbjohnson
Copy link
Contributor

@patriczek Thanks for the update to your commit! lgtm

@patriczek
Copy link
Contributor Author

@benbjohnson You are welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure migrated buckets have correct retention policy
2 participants