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

Results of queries with that involve the same field key panics #3200

Closed
desa opened this issue Jun 30, 2015 · 11 comments
Closed

Results of queries with that involve the same field key panics #3200

desa opened this issue Jun 30, 2015 · 11 comments
Assignees
Milestone

Comments

@desa
Copy link
Contributor

desa commented Jun 30, 2015

Built from source v0.9.x

The query

select value * value from cpu_user limit 1

yields two value columns

name: cpu_user
--------------
time                value   value
2015-06-26T21:34:26.85363181Z   1.4758622874084473e+07

Similarly the query

select value * value * value from cpu_user limit 1

yields tree value columns.

name: cpu_user
--------------
time                value   value   value
2015-06-26T21:34:26.85363181Z   2.7929823501472473e+06
@beckettsean
Copy link
Contributor

@corylanou another one for the columns returned from queries

@otoolep
Copy link
Contributor

otoolep commented Aug 12, 2015

Spoke with @mjdesa briefly about this, it's a weird one. Basically the query-engine code sees two "fields" in the query, and therefore preps two columns in the output. It might be a quick fix, it might not be.

@otoolep
Copy link
Contributor

otoolep commented Aug 12, 2015

Queries such as these now cause the server to panic.

@otoolep otoolep assigned otoolep and unassigned corylanou Aug 12, 2015
@pauldix
Copy link
Member

pauldix commented Aug 18, 2015

@otoolep can you confirm if this still panics the server?

@otoolep
Copy link
Contributor

otoolep commented Aug 18, 2015

I believe it does still panic the system, but I got side tracked by other
work. Let me get back into this.

On Tuesday, August 18, 2015, Paul Dix [email protected] wrote:

@otoolep https://github.com/otoolep can you confirm if this still
panics the server?


Reply to this email directly or view it on GitHub
#3200 (comment).

@beckettsean
Copy link
Contributor

It does still panic the system.

root@sean-test:~# /opt/influxdb/influx
Connected to http://localhost:8086 version 0.9.3-nightly-1548f62
InfluxDB shell 0.9.3-nightly-1548f62
> select value * value from thing
ERR: Get http://localhost:8086/query?db=foo&q=select+value+%2A+value+from+thing: EOF
panic: runtime error: index out of range

First few lines of the panic:

goroutine 148 [running]:
github.com/influxdb/influxdb/influxql.func·016(0xc2080dc960, 0x2, 0x2, 0x8fbe20, 0xc208083f30)
        /tmp/tmp.yrqIWEIVNQ/src/github.com/influxdb/influxdb/influxql/result.go:146 +0x4a
github.com/influxdb/influxdb/influxql.func·020(0xc2080dc960, 0x2, 0x2, 0x0, 0x0)
        /tmp/tmp.yrqIWEIVNQ/src/github.com/influxdb/influxdb/influxql/result.go:186 +0xa8
github.com/influxdb/influxdb/tsdb.processForMath(0xc208038130, 0x1, 0x1, 0xc2081197d0, 0x2, 0x2, 0x0, 0x0, 0x0)
        /tmp/tmp.yrqIWEIVNQ/src/github.com/influxdb/influxdb/tsdb/executor.go:867 +0x4ad
github.com/influxdb/influxdb/tsdb.(*limitedRowWriter).processValues(0xc20809d2c0, 0xc20813a000, 0x2, 0x2710, 0x0)
        /tmp/tmp.yrqIWEIVNQ/src/github.com/influxdb/influxdb/tsdb/executor.go:760 +0xf45
github.com/influxdb/influxdb/tsdb.(*limitedRowWriter).Flush(0xc20809d2c0)
        /tmp/tmp.yrqIWEIVNQ/src/github.com/influxdb/influxdb/tsdb/executor.go:661 +0xd6
github.com/influxdb/influxdb/tsdb.(*Executor).executeRaw(0xc2081187e0, 0xc2080f50e0)
        /tmp/tmp.yrqIWEIVNQ/src/github.com/influxdb/influxdb/tsdb/executor.go:228 +0x4e2
created by github.com/influxdb/influxdb/tsdb.(*Executor).Execute
        /tmp/tmp.yrqIWEIVNQ/src/github.com/influxdb/influxdb/tsdb/executor.go:88 +0x9a

@otoolep
Copy link
Contributor

otoolep commented Aug 18, 2015

Yeah, I'm in this code now.

This may not be a quick fix, there is some confused code (the code is confused, not me :-) ) within our system and I'm trying to see what is the best way to resolve this.

@otoolep
Copy link
Contributor

otoolep commented Aug 18, 2015

Changes to fix this will potentially ripple through the code, and it may be even more complicated to fix queries such as value 1* value2 where the data point fields within the query are actually different (but the parser considers it a single field).

It may be too close to the 0.9.3 freeze to consider the changes this would have on the code base.

@otoolep otoolep modified the milestones: 0.9.4, 0.9.3 Aug 18, 2015
@otoolep
Copy link
Contributor

otoolep commented Aug 18, 2015

Pushing out to 0.9.4.

@otoolep otoolep changed the title Results of queries with that involve the same field key multiple times include duplicate columns Results of queries with that involve the same field key panics Sep 9, 2015
@otoolep otoolep modified the milestones: 0.9.5, 0.9.4 Sep 9, 2015
@otoolep
Copy link
Contributor

otoolep commented Sep 9, 2015

Too much else going on in 0.9.4 - pushing out.

@beckettsean
Copy link
Contributor

closing in favor of #4046, which is more generic and cleaner.

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