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

[0.9.0-rc31] exceeding max retention policy duration gives incorrect error message #2762

Closed
beckettsean opened this issue Jun 3, 2015 · 2 comments · Fixed by #7296
Closed
Assignees
Milestone

Comments

@beckettsean
Copy link
Contributor

I'm not sure what the max allowable retention policy is (other than INF), but when trying to make an RP with a duration of 100,000 weeks I got a silly error:

> alter retention policy foo on mydb duration 1000000w
ERR: retention policy duration needs to be at least 1h0m0s

Seems like we should tell the user they've exceeded the max discrete RP rather than lie and say 100k weeks is shorter than an hour.

Note that 10,000 weeks works just fine:

> alter retention policy foo on mydb duration 10000w
> show retention policies mydb
name    duration    replicaN    default
default 0       1       true
foo 1680000h0m0s    1       false
@beckettsean
Copy link
Contributor Author

Looks like the max RP duration is stored as a signed 64-bit integer, so the max is defined by 2^63-1 nanoseconds, which works out to ~54,000 weeks

@corylanou
Copy link
Contributor

It overflows the int64:

http://play.golang.org/p/t7roIGTSiV

So it is probably erring out that it couldn't parse the int, and assumes you didn't provide a valid int. I think clarifying the error message is the right fix.

@beckettsean beckettsean added this to the 0.9.2 milestone Jun 9, 2015
@beckettsean beckettsean changed the title max retention policy duration not being properly enforced [0.9.0-rc31] exceeding max retention policy duration gives incorrect error message Jun 9, 2015
@beckettsean beckettsean modified the milestones: 0.9.3, 0.9.2 Jul 8, 2015
@beckettsean beckettsean modified the milestones: Next Point Release, 0.9.3 Aug 6, 2015
@jsternberg jsternberg modified the milestones: 1.1.0, Future Point Release Aug 1, 2016
@corylanou corylanou self-assigned this Sep 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants