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

Modify the max nanosecond time to be one nanosecond less #6850

Merged
merged 1 commit into from
Jun 16, 2016

Conversation

jsternberg
Copy link
Contributor

@jsternberg jsternberg commented Jun 15, 2016

The highest time represented by a nanosecond needs to be used for an
exclusive range, so the maximum time needs to be one less than the
possible maximum number of nanoseconds representable by an int64 so that
we don't lose a point at that one time.

Previously worked in the open source version because the timestamp used
for finding a shard would be truncated by the retention policy so the
lookup time didn't run into this edge case because it didn't rest on the
truncation boundary. Since that point didn't really belong in that shard
group and was placed there by mistake, it's best to fix this bug since
the timestamp used to create the shard group should be capable of
retrieving it.

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @e-dard and @joelegasse to be potential reviewers

@jsternberg jsternberg force-pushed the js-shard-group-max-time branch 3 times, most recently from 570d609 to 68ee53e Compare June 16, 2016 13:19
@@ -20,7 +20,7 @@ const (
//
// 2262-04-11 23:47:16.854775807 +0000 UTC
//
MaxNanoTime = int64(math.MaxInt64)
MaxNanoTime = int64(math.MaxInt64) - 1
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to update the timestamp in the comment to be 1ns less.

@e-dard
Copy link
Contributor

e-dard commented Jun 16, 2016

LGTM 👍 with the comment fix

The highest time represented by a nanosecond needs to be used for an
exclusive range, so the maximum time needs to be one less than the
possible maximum number of nanoseconds representable by an int64 so that
we don't lose a point at that one time.

Previously worked in the open source version because the timestamp used
for finding a shard would be truncated by the retention policy so the
lookup time didn't run into this edge case because it didn't rest on the
truncation boundary. Since that point didn't really belong in that shard
group and was placed there by mistake, it's best to fix this bug since
the timestamp used to create the shard group should be capable of
retrieving it.
@jsternberg jsternberg force-pushed the js-shard-group-max-time branch from 68ee53e to 8e1b036 Compare June 16, 2016 17:15
@jsternberg
Copy link
Contributor Author

@e-dard I also fixed the influxql package change you pointed out. It looks like shard group times are [start, end), the check for min and max nanosecond times was [start, end] (so not compatible with the shard group times), and the influxql time was [start, end) (so it was correct). So now those values should be the same and the shard group end time is one nanosecond more.

@e-dard
Copy link
Contributor

e-dard commented Jun 16, 2016

@jsternberg :shipit:

@jsternberg jsternberg merged commit 65e9903 into master Jun 16, 2016
@jsternberg jsternberg deleted the js-shard-group-max-time branch June 16, 2016 18:12
@timhallinflux timhallinflux added this to the 1.0.0 milestone Dec 20, 2016
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.

4 participants