influxdb icon indicating copy to clipboard operation
influxdb copied to clipboard

2.7.10 may have a bug about function limit()

Open Zys97kobe opened this issue 1 year ago • 7 comments

I can find 532 pieces of data image

but when i used limit(n:20, offset: 530) i got a panic :index out of range image

Zys97kobe avatar Oct 24 '24 03:10 Zys97kobe

2.7.9 has no this bug image

Zys97kobe avatar Oct 24 '24 06:10 Zys97kobe

This seems to be related to the association of a certain label of a certain piece of data, but the panic only appeared in 2.7.10WX20241024-155407@2x WX20241024-155646

Zys97kobe avatar Oct 24 '24 07:10 Zys97kobe

@Zys97kobe - any chance you can provide the stack trace as text instead of a screenshot like you did above? It is difficult to read the image.

philjb avatar Oct 24 '24 18:10 philjb

@philjb OK I posted the log text here Oct 24 15:51:50 sdwan-controller-perf-1 50d326f48352[2124]: ts=2024-10-24T07:51:50.155427Z lvl=info msg="Invalid column reader received from predecessor" log_id=0rqs9kZ0000 service=storage-reads source="@12:6-12:31: limit" error="mismatched column lengths: map[_field:string:684 _measurement:string:684 accountId:string:684 accountName:string:684 category:string:684 event:string:684 level:string:684 module:string:684 others:string:684 receivedCircle:string:684 siteId:string:684 siteName:string:684 sn:string:684 time:time:684 vrfId:string:683 vrfName:string:684]" Oct 24 15:51:50 sdwan-controller-perf-1 50d326f48352[2124]: ts=2024-10-24T07:51:50.155528Z lvl=info msg="Dispatcher panic" log_id=0rqs9kZ0000 service=storage-reads component=dispatcher error="panic: arrow/array: index out of range" stacktrace="goroutine 193799306 [running]:\nruntime/debug.Stack()\n\t/go/src/runtime/debug/stack.go:24 +0x5e\ngithub.com/influxdata/flux/execute.(*poolDispatcher).recover(0xc0129cea80)\n\t/go/pkg/mod/github.com/influxdata/[email protected]/execute/recover.go:53 +0x1f3\npanic({0x7f36c009bc20?, 0x7f36c067c200?})\n\t/go/src/runtime/panic.go:914 +0x21f\ngithub.com/apache/arrow/go/v7/arrow/array.NewSliceData({0x7f36c06ce170, 0xc01c81a4e0}, 0x2a8, 0x2ac)\n\t/go/pkg/mod/github.com/apache/arrow/go/[email protected]/arrow/array/data.go:154 +0x2ed\ngithub.com/influxdata/flux/array.(*String).Slice(0xc017f451d0, 0x7f36c06cd9f0?, 0xc017f451d0?)\n\t/go/pkg/mod/github.com/influxdata/[email protected]/array/array.go:146 +0xfb\ngithub.com/influxdata/flux/array.Slice({0x7f36c06cd9f0?, 0xc017f451d0}, 0x7f36bcb47879?, 0x7f36c009bda0?)\n\t/go/pkg/mod/github.com/influxdata/[email protected]/array/array.go:177 +0xae\ngithub.com/influxdata/flux/arrow.Slice(...)\n\t/go/pkg/mod/github.com/influxdata/[email protected]/arrow/utils.go:130\ngithub.com/influxdata/flux/stdlib/universe.(*limitTransformation).processChunk(0x7f36c06db6c0?, {{{0x7f36c06db6c0, 0xc021611b80}, {0xc010f92600, 0x10, 0x10}, {0xc01da23600, 0x10, 0x10}}}, 0xc032883070, ...)\n\t/go/pkg/mod/github.com/influxdata/[email protected]/stdlib/universe/limit.go:195 +0x425\ngithub.com/influxdata/flux/stdlib/universe.(*limitTransformation).Process(0x7f36bcb473c5?, {{{0x7f36c06db6c0, 0xc021611b80}, {0xc010f92600, 0x10, 0x10}, {0xc01da23600, 0x10, 0x10}}}, 0xc032883070, ...)\n\t/go/pkg/mod/github.com/influxdata/[email protected]/stdlib/universe/limit.go:133 +0xdf\ngithub.com/influxdata/flux/execute.(*narrowStateTransformation[...]).ProcessMessage(0x7f36c06c4da0, {0x7f36c06b1af0, 0xc01c81a6c0?})\n\t/go/pkg/mod/github.com/influxdata/[email protected]/execute/narrow_state_transformation.go:51 +0x2aa\ngithub.com/influxdata/flux/execute.(*transportTransformationAdapter).processChunk(...)\n\t/go/pkg/mod/github.com/influxdata/[email protected]/execute/transport.go:762\ngithub.com/influxdata/flux/execute.(*transportTransformationAdapter).Process.func1({0x7f36c06d3990?, 0xc0276d05c0?})\n\t/go/pkg/mod/github.com/influxdata/[email protected]/execute/transport.go:749 +0x294\ngithub.com/influxdata/flux/execute.(*consecutiveTransportTable).Do.func1({0x7f36c06d3990, 0xc0276d05c0})\n\t/go/pkg/mod/github.com/influxdata/[email protected]/execute/transport.go:572 +0x45f\ngithub.com/influxdata/flux/execute/table.(*BufferedTable).Do(0x7f36c0362e20?, 0xc02affce40)\n\t/go/pkg/mod/github.com/influxdata/[email protected]/execute/table/buffered.go:69 +0x177\ngithub.com/influxdata/flux/execute.(*consecutiveTransportTable).Do(0xc02affce10, 0xc0357ce900)\n\t/go/pkg/mod/github.com/influxdata/[email protected]/execute/transport.go:554 +0x76\ngithub.com/influxdata/flux/execute.(*transportTransformationAdapter).Process(0xc030b214d0, {0xe9, 0x75, 0x87, 0xdf, 0xa7, 0x57, 0x51, 0xf6, 0xa3, ...}, ...)\n\t/go/pkg/mod/github.com/influxdata/[email protected]/execute/transport.go:746 +0x370\ngithub.com/influxdata/flux/execute.(*transportTransformationAdapter).ProcessMessage(0xc030b214d0, {0x7f36c06b1b98?, 0xc0357ce860})\n\t/go/pkg/mod/github.com/influxdata/[email protected]/execute/transport.go:727 +0x131\ngithub.com/influxdata/flux/execute.(*consecutiveTransport).processMessage(0xc01b08ac30, {0x7f36c06b1b98, 0xc0357ce860})\n\t/go/pkg/mod/github.com/influxdata/[email protected]/execute/transport.go:297 +0xbb\ngithub.com/influxdata/flux/execute.(*consecutiveTransport).processMessages(0xc01b08ac30, {0x7f36c06af1f0?, 0xc013d7f220?}, 0xa)\n\t/go/pkg/mod/github.com/influxdata/[email protected]/execute/transport.go:251 +0xe5\ngithub.com/influxdata/flux/execute.(*poolDispatcher).doWork(0xc0129cea80, {0x7f36c06af1f0, 0xc013d7f220})\n\t/go/pkg/mod/github.com/influxdata/[email protected]/execute/dispatcher.go:157 +0x18c\ngithub.com/influxdata/flux/execute.(*poolDispatcher).run(0xc0129cea80, {0x7f36c06af1f0, 0xc013d7f220})\n\t/go/pkg/mod/github.com/influxdata/[email protected]/execute/dispatcher.go:135 +0x49\ngithub.com/influxdata/flux/execute.(*poolDispatcher).Start.func1()\n\t/go/pkg/mod/github.com/influxdata/[email protected]/execute/dispatcher.go:75 +0x85\ncreated by github.com/influxdata/flux/execute.(*poolDispatcher).Start in goroutine 4073\n\t/go/pkg/mod/github.com/influxdata/[email protected]/execute/dispatcher.go:71 +0x46\n"

Zys97kobe avatar Oct 25 '24 03:10 Zys97kobe

I have what I think is a related error when doing a join.left:

ts=2025-06-09T19:36:46.480778Z lvl=info msg="Dispatcher panic" log_id=0wpXXxDG000 service=storage-reads component=dispatcher error="panic: arrow/array: index out of range" stacktrace="goroutine 10835987 [running]:
runtime/debug.Stack()
	/go/src/runtime/debug/stack.go:24 +0x5e
github.com/influxdata/flux/execute.(*poolDispatcher).recover(0xc00de71180)
	/go/pkg/mod/github.com/influxdata/[email protected]/execute/recover.go:53 +0x1fb
panic({0x7e7258085b40?, 0x7e7258662e40?})
	/go/src/runtime/panic.go:770 +0x132
github.com/apache/arrow/go/v7/arrow/array.NewSliceData({0x7e72586b78a0, 0xc01c5e3f20}, 0x105, 0x106)
	/go/pkg/mod/github.com/apache/arrow/go/[email protected]/arrow/array/data.go:154 +0x2d2
github.com/influxdata/flux/array.(*String).Slice(0x7e72586bb928?, 0x105, 0x106)
	/go/pkg/mod/github.com/influxdata/[email protected]/array/array.go:146 +0xfc
github.com/influxdata/flux/array.Slice({0x7e72586b7120, 0xc01b6ac140}, 0x105, 0x106)
	/go/pkg/mod/github.com/influxdata/[email protected]/array/array.go:177 +0x7d
github.com/influxdata/flux/arrow.Slice(...)
	/go/pkg/mod/github.com/influxdata/[email protected]/arrow/utils.go:130
github.com/influxdata/flux/stdlib/join.getChunkSlice({{{0x7e72586c67e0, 0xc0123c1220}, {0xc026202000, 0x9, 0x10}, {0xc01547f050, 0x9, 0x9}}}, 0x105, 0x106)
	/go/pkg/mod/github.com/influxdata/[email protected]/stdlib/join/merge_join.go:553 +0x313
github.com/influxdata/flux/stdlib/join.(*sideState).scan(0xc00c4d0090, {{{0x7e72586c67e0, 0xc0123c1220}, {0xc026202000, 0x9, 0x10}, {0xc01547f050, 0x9, 0x9}}})
	/go/pkg/mod/github.com/influxdata/[email protected]/stdlib/join/merge_join.go:473 +0x15b
github.com/influxdata/flux/stdlib/join.(*joinState).scanKey(0xc00c4d0000, {{{0x7e72586c67e0, 0xc0123c1220}, {0xc026202000, 0x9, 0x10}, {0xc01547f050, 0x9, 0x9}}}, 0x0, ...)
	/go/pkg/mod/github.com/influxdata/[email protected]/stdlib/join/merge_join.go:296 +0x12d
github.com/influxdata/flux/stdlib/join.(*MergeJoinTransformation).mergeJoin(0xc00b2c5c80, {{{0x7e72586c67e0, 0xc0123c1220}, {0xc026202000, 0x9, 0x10}, {0xc01547f050, 0x9, 0x9}}}, 0xc00c4d0000, ...)
	/go/pkg/mod/github.com/influxdata/[email protected]/stdlib/join/merge_join.go:210 +0xe5
github.com/influxdata/flux/stdlib/join.(*MergeJoinTransformation).processChunk(0xc00b2c5c80, {{{0x7e72586c67e0, 0xc0123c1220}, {0xc026202000, 0x9, 0x10}, {0xc01547f050, 0x9, 0x9}}}, {0x0, ...}, ...)
	/go/pkg/mod/github.com/influxdata/[email protected]/stdlib/join/merge_join.go:177 +0x795
github.com/influxdata/flux/stdlib/join.(*MergeJoinTransformation).ProcessMessage(0xc00b2c5c80, {0x7e7258698ad8, 0xc01a3f9800})
	/go/pkg/mod/github.com/influxdata/[email protected]/stdlib/join/merge_join.go:86 +0x748
github.com/influxdata/flux/execute.(*transportTransformationAdapter).processChunk(...)
	/go/pkg/mod/github.com/influxdata/[email protected]/execute/transport.go:762
github.com/influxdata/flux/execute.(*transportTransformationAdapter).Process.func1({0x7e72586bd1c0?, 0xc0298a6f00?})
	/go/pkg/mod/github.com/influxdata/[email protected]/execute/transport.go:749 +0x293
github.com/influxdata/flux/execute.(*consecutiveTransportTable).Do.func1({0x7e72586bd1c0, 0xc0298a6f00})
	/go/pkg/mod/github.com/influxdata/[email protected]/execute/transport.go:572 +0x479
github.com/influxdata/flux/execute/table.(*BufferedTable).Do(0x7e725834e4a0?, 0xc00e1af980)
	/go/pkg/mod/github.com/influxdata/[email protected]/execute/table/buffered.go:69 +0x177
github.com/influxdata/flux/execute.(*consecutiveTransportTable).Do(0xc00e1af038, 0xc001b0ff20)
	/go/pkg/mod/github.com/influxdata/[email protected]/execute/transport.go:554 +0x76
github.com/influxdata/flux/execute.(*transportTransformationAdapter).Process(0xc014144360, {0x4f, 0xcb, 0x72, 0xd6, 0x44, 0xf5, 0x5a, 0x12, 0x92, ...}, ...)
	/go/pkg/mod/github.com/influxdata/[email protected]/execute/transport.go:746 +0x370
github.com/influxdata/flux/execute.(*transportTransformationAdapter).ProcessMessage(0xc014144360, {0x7e7258698bb8?, 0xc001b0ed80})
	/go/pkg/mod/github.com/influxdata/[email protected]/execute/transport.go:727 +0x1ab
github.com/influxdata/flux/execute.(*consecutiveTransport).processMessage(0xc0129463c0, {0x7e7258698bb8, 0xc001b0ed80})
	/go/pkg/mod/github.com/influxdata/[email protected]/execute/transport.go:297 +0xbb
github.com/influxdata/flux/execute.(*consecutiveTransport).processMessages(0xc0129463c0, {0x7e7258696250?, 0xc016609ef0?}, 0xa)
	/go/pkg/mod/github.com/influxdata/[email protected]/execute/transport.go:251 +0xe5
github.com/influxdata/flux/execute.(*poolDispatcher).doWork(0xc00de71180, {0x7e7258696250, 0xc016609ef0})
	/go/pkg/mod/github.com/influxdata/[email protected]/execute/dispatcher.go:157 +0x18c
github.com/influxdata/flux/execute.(*poolDispatcher).run(0xc00de71180, {0x7e7258696250, 0xc016609ef0})
	/go/pkg/mod/github.com/influxdata/[email protected]/execute/dispatcher.go:135 +0x49
github.com/influxdata/flux/execute.(*poolDispatcher).Start.func1()
	/go/pkg/mod/github.com/influxdata/[email protected]/execute/dispatcher.go:75 +0x85
created by github.com/influxdata/flux/execute.(*poolDispatcher).Start in goroutine 3029
	/go/pkg/mod/github.com/influxdata/[email protected]/execute/dispatcher.go:71 +0x51
"

My query is:

import "join"

air = from(bucket: "meshtastic")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_field"] == "air_util_tx")
  |> filter(fn: (r) => r["_value"] < 200 and r["_value"] >= 0)
  |> filter(fn: (r) => if length(arr: [ ]) == 0 then true else contains(value: r._from, set: [ ]))
  |> group(columns: ["_from"])
  |> rename(columns: {_from: "id"})
  |> group()
  

nodes = from(bucket: "meshtastic")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "node")
  |> drop(columns: ["_field", "_value", "_start", "_stop", "to", "channel_id"])
  |> group(columns: ["_from", "short_name", "long_name"])
  |> last(column: "_from")
  |> rename(columns: {_from: "id"})
  |> group()


joined = join.left(
    left: air,
    right: nodes,
    on: (l, r) => l.id == r.id,
    as: (l, r) => ({l with short_name: r.short_name, long_name: r.long_name})
  )

joined
  |> group(columns: ["_measurement", "_field", "id", "short_name", "long_name"])
  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)

About 225 rows in the nodes query and 2000 in the air query. This is with 2.7.11.

andyshinn avatar Jun 09 '25 19:06 andyshinn

Another Flux/Arrow panic: https://github.com/influxdata/influxdb/issues/23484

davidby-influx avatar Jun 09 '25 21:06 davidby-influx

And another: https://github.com/influxdata/influxdb/issues/23265

davidby-influx avatar Jun 09 '25 21:06 davidby-influx

This is fixed in flux v0.197.0. The upgrade PR is #26564

mhilton avatar Jun 26 '25 07:06 mhilton