Skip to content

Commit

Permalink
Don't close tsm cursor prematurely
Browse files Browse the repository at this point in the history
We were closing the cursor when we read the last block which caused
the internal state to be cleared.  In a group by query, we seeked multiple
times so depending on the group by interval and how the data was laid out
in the blocks, we woudl close the cursor and the last block would get skipped.

Fixes influxdata#5193
  • Loading branch information
jwilder committed Jan 10, 2016
1 parent 72c6a51 commit 5b17911
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ With this release InfluxDB is moving to Go 1.5.
- [#5158](https://github.com/influxdb/influxdb/pull/5158): Fix panic when writing invalid input to the line protocol.
- [#5264](https://github.com/influxdata/influxdb/pull/5264): Fix panic: runtime error: slice bounds out of range
- [#5186](https://github.com/influxdata/influxdb/pull/5186): Fix database creation with retention statement parsing. Fixes [#5077](https://github.com/influxdb/influxdb/issues/5077). Thanks @pires
- [#5193](https://github.com/influxdata/influxdb/issues/5193): Missing data a minute before current time. Comes back later.

## v0.9.6 [2015-12-09]

Expand Down
2 changes: 0 additions & 2 deletions tsdb/engine/tsm1/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,6 @@ func (c *devCursor) nextTSM() (int64, interface{}) {
if c.tsmPos >= len(c.tsmValues) {
c.tsmValues, _ = c.tsmKeyCursor.Next(c.ascending)
if len(c.tsmValues) == 0 {
c.tsmKeyCursor.Close()
return tsdb.EOF, nil
}
c.tsmPos = 0
Expand All @@ -826,7 +825,6 @@ func (c *devCursor) nextTSM() (int64, interface{}) {
if c.tsmPos < 0 {
c.tsmValues, _ = c.tsmKeyCursor.Next(c.ascending)
if len(c.tsmValues) == 0 {
c.tsmKeyCursor.Close()
return tsdb.EOF, nil
}
c.tsmPos = len(c.tsmValues) - 1
Expand Down

0 comments on commit 5b17911

Please sign in to comment.