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.10.0] panic in model.Points.scanTo #5664

Closed
dvusboy opened this issue Feb 12, 2016 · 4 comments
Closed

[0.10.0] panic in model.Points.scanTo #5664

dvusboy opened this issue Feb 12, 2016 · 4 comments

Comments

@dvusboy
Copy link

dvusboy commented Feb 12, 2016

I'm using telegraf feeding into influxdb. In order to compute the % CPU usage of a container as a time series, it is necessary to compute the change in measurements like docker_cpu.total_usage. Since expressions of aggregates and the function difference() aren't supported yet, I thought of using a continuous query to precompute these deltas. Basically, within a GROUP BY time interval, compute LAST(total_usage) - FIRST(total_usage) (or MAX(total_usage) - MIN(total_usage), they should be the same).

What I'm running into is a panic and influxdb crashes.

  • Is my query messed up? Or,
  • Is this a bug in influxdb?

I've included the backtrace and the query in this gist.

@jwilder jwilder changed the title [0.10.0] continuous query crashing with index out of range panic [0.10.0] panic in model.Points.scanTo Feb 15, 2016
@jwilder
Copy link
Contributor

jwilder commented Feb 15, 2016

@e-dard 789aff9 might have introduced this. Any ideas?

e-dard added a commit that referenced this issue Feb 16, 2016
@e-dard e-dard mentioned this issue Feb 16, 2016
@e-dard
Copy link
Contributor

e-dard commented Feb 16, 2016

@jwilder fixed this. Though it's slightly perplexing because scanTo only gets called for various delimiter values, e.g., = or , AFAIK. In the case that the stop value is also the first character of buf, the parser should error out before a call to scanTo. I will revisit in the future.

@dvusboy
Copy link
Author

dvusboy commented Feb 16, 2016

Alas, I don't have the full log leading up to the crash. All I have is this snippet just before the backtrace in the gist:

2016-02-12T21:26:55.676264820Z [meta] 2016/02/12 21:26:55 127.0.0.1 - - [12/Feb/2016:21:26:55 +0000] GET /lease?name=continuous_querier&nodeid=0 HTTP/1.1 200 106 - Go-http-client/1.1 573d5b0f-d1cf-11e5-803c-000000000000 1.781658ms
2016-02-12T21:26:55.873619472Z [wal] 2016/02/12 21:26:55 write to index of partition 1 took 245.31988ms
2016-02-12T21:26:56.679888889Z [meta] 2016/02/12 21:26:56 127.0.0.1 - - [12/Feb/2016:21:26:56 +0000] GET /lease?name=continuous_querier&nodeid=0 HTTP/1.1 200 106 - Go-http-client/1.1 57d68199-d1cf-11e5-803d-000000000000 1.7249ms
2016-02-12T21:26:57.683457109Z [meta] 2016/02/12 21:26:57 127.0.0.1 - - [12/Feb/2016:21:26:57 +0000] GET /lease?name=continuous_querier&nodeid=0 HTTP/1.1 200 106 - Go-http-client/1.1 586fa3ce-d1cf-11e5-803e-000000000000 1.745397ms
2016-02-12T21:26:58.687429516Z [meta] 2016/02/12 21:26:58 127.0.0.1 - - [12/Feb/2016:21:26:58 +0000] GET /lease?name=continuous_querier&nodeid=0 HTTP/1.1 200 106 - Go-http-client/1.1 5908c589-d1cf-11e5-803f-000000000000 2.017598ms
2016-02-12T21:26:59.691900968Z [meta] 2016/02/12 21:26:59 127.0.0.1 - - [12/Feb/2016:21:26:59 +0000] GET /lease?name=continuous_querier&nodeid=0 HTTP/1.1 200 106 - Go-http-client/1.1 59a218c8-d1cf-11e5-8040-000000000000 1.740024ms
2016-02-12T21:27:00.297889443Z [http] 2016/02/12 21:27:00 192.168.22.99 - - [12/Feb/2016:21:27:00 +0000] POST /write?consistency=&db=telegraf&precision=s&rp= HTTP/1.1 204 0 - InfluxDBClient 59f0bd44-d1cf-11e5-8041-000000000000 92.326954ms
2016-02-12T21:27:00.695455927Z [meta] 2016/02/12 21:27:00 127.0.0.1 - - [12/Feb/2016:21:27:00 +0000] GET /lease?name=continuous_querier&nodeid=0 HTTP/1.1 200 106 - Go-http-client/1.1 5a3b3b50-d1cf-11e5-8042-000000000000 1.736889ms

I hope this helps.

@jonseymour
Copy link
Contributor

@e-dard just in case it is useful to you, I have a query that caused this in my database.

select count(value)/60 into "default"."count.foobar" from "foobar.state" where time > now() - 24h group by time(5m), foo, bar

The series "foobar.state" has to exist and have data in the range specified by the time filter - it won't crash otherwise.

jonseymour added a commit to jonseymour/influxdb that referenced this issue Feb 17, 2016
Previously, influx would either panic (influxdata#5664) or enter a loop (post-influxdata#5697) in
the case that a binary point contained an empty field name.

Now we tolerate the case by skipping the empty field.

Signed-off-by: Jon Seymour <jon@wildducktheories.com>
jonseymour added a commit to jonseymour/influxdb that referenced this issue Feb 20, 2016
Note that this series also includes cherry-pick of influxdata#5697.

Signed-off-by: Jon Seymour <jon@wildducktheories.com>
@e-dard e-dard closed this as completed in 88937ab Feb 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants