-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Description
I have asked for help in Slack and will follow up with customer support, but I thought I would also post this here.
I am currently using influxdb cloud as our primary data store. All data is coming in from an mqtt server. I recently spun up a local influxdb instance in a docker container and am sending a copy of the data to a this new local server for testing. The local server adds a few new tags, but besides that, everything else should be the same. Same bucket name, same data structure, etc. I'm doing this so I can just drop in this new server into existing Grafana dashboards and test some things before we push changes that go to the production server.
When I run the same queries from the cloud against the local server, I have some that cause influxdb to panic.
from(bucket: "bucket")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "Sample")
|> filter(fn: (r) => r["serial"] == "xxx.xxx")
|> filter(fn: (r) => r["channel"] == "Cellular")
|> aggregateWindow(every: v.windowPeriod, fn: min, createEmpty: false)
This runs fine on the cloud server, but when I run it locally, I get
panic: unsupported for aggregate min: *reads.stringMultiShardArrayCursor
and if I comment out the aggregateWindow, then it returns the data as I'd expect. One thing to note is when I run this query, the _value
column data type is a double in the cloud and a long on the local instance, but besides that, the tables look identical when I comment out the aggregateWindow.
Oddly enough, I just noticed that if I change the query from
|> filter(fn: (r) => r["channel"] == "Cellular")
to
|> filter(fn: (r) => r["_field"] == "Status.Cellular")
which targets the same data rows, but a different way, then I do not get this panic and the data returns as expected with the aggregateWindow.
Any insight as to why this query would be successful in the cloud version but panic in the OSS version will be much appreciated.
InfluxDB v2.7.11
Server: fbf5d4a
Logs:
influxdb-1 | ts=2025-03-14T15:39:37.538278Z lvl=info msg="Execute source panic" log_id=0vHGw81W000 service=storage-reads error="panic: unsupported for aggregate min: *reads.stringMultiShardArrayCursor" stacktrace="goroutine 207758 [running]:\nruntime/debug.Stack()\n\t/go/src/runtime/debug/stack.go:24 +0x5e\ngithub.com/influxdata/flux/execute.(*executionState).recover(0xc002241170)\n\t/go/pkg/mod/github.com/influxdata/flux@v0.195.2/execute/recover.go:32 +0x1fd\npanic({0x7f33d4a24b40?, 0xc0036f9650?})\n\t/go/src/runtime/panic.go:770 +0x132\ngithub.com/influxdata/influxdb/v2/storage/reads.newWindowMinArrayCursor({0x7f33d502de40?, 0xc00735d850?}, {{0x0, 0x2540be400, 0x0}, {0x0, 0x2540be400, 0x0}, 0x0, 0x0, ...})\n\t/root/project/storage/reads/array_cursor.gen.go:158 +0x40c\ngithub.com/influxdata/influxdb/v2/storage/reads.newWindowAggregateArrayCursor({0xc0069e5dc0?, 0x9?}, 0x9?, {{0x0, 0x2540be400, 0x0}, {0x0, 0x2540be400, 0x0}, 0x0, ...}, ...)\n\t/root/project/storage/reads/array_cursor.go:43 +0x9c\ngithub.com/influxdata/influxdb/v2/storage/reads.(*windowAggregateResultSet).createCursor(0xc0069e3770, {{0x0, 0x0, 0x0}, {0x7f3384608495, 0x6, 0x3f7b6b}, {0xc002071340, 0x7, 0x7}, ...})\n\t/root/project/storage/reads/aggregate_resultset.go:131 +0x2a6\ngithub.com/influxdata/influxdb/v2/storage/reads.(*windowAggregateResultSet).Next(0xc0069e3770)\n\t/root/project/storage/reads/aggregate_resultset.go:84 +0x138\ngithub.com/influxdata/influxdb/v2/storage/flux.(*windowAggregateIterator).handleRead(0xc00295a100, 0x7f33d5035218?, {0x7f33d5048520, 0xc0069e3770})\n\t/root/project/storage/flux/reader.go:742 +0x3aa\ngithub.com/influxdata/influxdb/v2/storage/flux.(*windowAggregateIterator).Do(0xc00295a100, 0xc0016b3ae0)\n\t/root/project/storage/flux/reader.go:688 +0x365\ngithub.com/influxdata/influxdb/v2/query/stdlib/influxdata/influxdb.(*Source).processTables(0xc002070f20, {0x7f33d5035218, 0xc0036fe090}, {0x7f33d5020118, 0xc00295a100}, 0x182cb58e09149c46)\n\t/root/project/query/stdlib/influxdata/influxdb/source.go:69 +0x9a\ngithub.com/influxdata/influxdb/v2/query/stdlib/influxdata/influxdb.(*readWindowAggregateSource).run(0xc002070f20, {0x7f33d5035218, 0xc0036fe090})\n\t/root/project/query/stdlib/influxdata/influxdb/source.go:303 +0x106\ngithub.com/influxdata/influxdb/v2/query/stdlib/influxdata/influxdb.(*Source).Run(0xc002070f20, {0x7f33d5035218, 0xc0036fe090})\n\t/root/project/query/stdlib/influxdata/influxdb/source.go:50 +0xa3\ngithub.com/influxdata/flux/execute.(*executionState).do.func2({0x7f33d5036d70, 0xc002070f20})\n\t/go/pkg/mod/github.com/influxdata/flux@v0.195.2/execute/executor.go:535 +0x375\ncreated by github.com/influxdata/flux/execute.(*executionState).do in goroutine 234\n\t/go/pkg/mod/github.com/influxdata/flux@v0.195.2/execute/executor.go:515 +0xf8\n"