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
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 @@ -72,6 +72,7 @@
- [#6771](https://github.com/influxdata/influxdb/issues/6771): Fix the point validation parser to identify and sort tags correctly.
- [#6835](https://github.com/influxdata/influxdb/pull/6835): Include sysvinit-tools as an rpm dependency.
- [#6834](https://github.com/influxdata/influxdb/pull/6834): Add port to all graphite log output to help with debugging multiple endpoints
- [#6850](https://github.com/influxdata/influxdb/pull/6850): Modify the max nanosecond time to be one nanosecond less.

## v0.13.0 [2016-05-12]

Expand Down
2 changes: 1 addition & 1 deletion influxql/iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const (

// MaxTime is used as the maximum time value when computing an unbounded range.
// This time is 2262-04-11 23:47:16.854775806 +0000 UTC
MaxTime = models.MaxNanoTime - 1
MaxTime = models.MaxNanoTime
)

// Iterator represents a generic interface for all Iterators.
Expand Down
2 changes: 1 addition & 1 deletion models/points_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,7 @@ func TestParsePointNegativeTimestamp(t *testing.T) {
}

func TestParsePointMaxTimestamp(t *testing.T) {
test(t, `cpu value=1 9223372036854775807`,
test(t, fmt.Sprintf(`cpu value=1 %d`, models.MaxNanoTime),
NewTestPoint(
"cpu",
models.Tags{},
Expand Down
4 changes: 2 additions & 2 deletions models/time.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ const (

// MaxNanoTime is the maximum time that can be represented.
//
// 2262-04-11 23:47:16.854775807 +0000 UTC
// 2262-04-11 23:47:16.854775806 +0000 UTC
//
MaxNanoTime = int64(math.MaxInt64)
MaxNanoTime = int64(math.MaxInt64) - 1
)

var (
Expand Down
3 changes: 2 additions & 1 deletion services/meta/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,8 @@ func (data *Data) CreateShardGroup(database, policy string, timestamp time.Time)
sgi.StartTime = timestamp.Truncate(rpi.ShardGroupDuration).UTC()
sgi.EndTime = sgi.StartTime.Add(rpi.ShardGroupDuration).UTC()
if sgi.EndTime.After(time.Unix(0, models.MaxNanoTime)) {
sgi.EndTime = time.Unix(0, models.MaxNanoTime)
// Shard group range is [start, end) so add one to the max time.
sgi.EndTime = time.Unix(0, models.MaxNanoTime+1)
}

data.MaxShardID++
Expand Down