Panic on deduplicate
Bug report
I got panic on deduplicate function many time. Starting influx service like everyday.
OS: Linux Tested versions: 1.3.5-stable, 1.3.6-stable
Panic:
[signal SIGSEGV: segmentation violation code=0x1 addr=0x80000ebc450 pc=0x9b14d9]
goroutine 2977573 [running]:
runtime.throw(0xb8a60b, 0x5)
/usr/local/go/src/runtime/panic.go:596 +0x95 fp=0xc429aa05f0 sp=0xc429aa05d0
runtime.sigpanic()
/usr/local/go/src/runtime/signal_unix.go:297 +0x28c fp=0xc429aa0640 sp=0xc429aa05f0
github.com/influxdata/influxdb/tsdb/engine/tsm1.Values.Deduplicate(0xc4222fc000, 0xae8, 0xe00, 0xc42e9ca000, 0xc421341058, 0xc42a16ef60)
/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/encoding.gen.go:66 +0x99 fp=0xc429aa06c0 sp=0xc429aa0640
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*entry).deduplicate(0xc420339a80)
/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/cache.go:125 +0x86 fp=0xc429aa0700 sp=0xc429aa06c0
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*Cache).Deduplicate.func1(0xc423d1a080, 0x72, 0xc420339a80, 0x0, 0x0)
/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/cache.go:431 +0x2b fp=0xc429aa0718 sp=0xc429aa0700
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*ring).apply.func1(0xc421e676b0, 0xbb0a58, 0xc426cbdec0, 0xc42055a600)
/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/ring.go:160 +0xed fp=0xc429aa07c0 sp=0xc429aa0718
Can you attach the full trace?
@semihalev unfortunately without more information we'll struggle to fix this. Do you have a longer stack trace?
@jwilder @e-dard
I'm so sorry, I missed your messages. I attached full trace log.
OS: Linux Version: 1.3.6
@semihalev are you still seeing this happen? Can you try updating to 1.4.2?
I updated to 1.4.2, I will check and inform you again.
Panic happened 5 times on 1.4.2, it's same error. I attached panic log before. Could you please check it?
@semihalev -- a fix was pushed for this item in Jan. Have you been able to reproduce using 1.5.1?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had recent activity. Please reopen if this issue is still important to you. Thank you for your contributions.
:+1
my panic logs:
Jul 20 21:58:28 hb06-umon-147-233 influx_storage: panic: runtime error: invalid memory address or nil pointer dereference
Jul 20 21:58:28 hb06-umon-147-233 influx_storage: [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0xbef9a3]
Jul 20 21:58:28 hb06-umon-147-233 influx_storage: goroutine 35090295734 [running]:
Jul 20 21:58:28 hb06-umon-147-233 influx_storage: github.com/influxdata/influxdb/tsdb/engine/tsm1.(*cacheKeyIterator).encode.func1(0xc471d4b3c8, 0x1, 0x17970c, 0xc1634f7100)
Jul 20 21:58:28 hb06-umon-147-233 influx_storage: /data/golang/own/pkg/mod/github.com/influxdata/[email protected]/tsdb/engine/tsm1/compact.go:1953 +0x363
Jul 20 21:58:28 hb06-umon-147-233 influx_storage: created by github.com/influxdata/influxdb/tsdb/engine/tsm1.(*cacheKeyIterator).encode
Jul 20 21:58:28 hb06-umon-147-233 influx_storage: /data/golang/own/pkg/mod/github.com/influxdata/[email protected]/tsdb/engine/tsm1/compact.go:1921 +0xa3
Jul 20 21:58:39 hb06-umon-147-233 systemd: influx_storage.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Jul 20 21:58:39 hb06-umon-147-233 systemd: Unit influx_storage.service entered failed state.
Jul 20 21:58:39 hb06-umon-147-233 systemd: influx_storage.service failed.
Jul 20 21:58:39 hb06-umon-147-233 systemd: influx_storage.service holdoff time over, scheduling restart.
Jul 20 21:58:39 hb06-umon-147-233 systemd: Started influx_storage, a storage service for influx-galaxy.
Jul 20 21:58:39 hb06-umon-147-233 systemd: Starting influx_storage, a storage service for influx-galaxy...
Jul 20 21:58:39 hb06-umon-147-233 influx_storage: ts=2020-07-20T13:58:39.437414Z lvl=info msg="Influx Storage starting" log_id=0O789OGl000 version=galaxy-storage-v1.0.5 branch=develop commit=a52903c
Jul 20 21:58:39 hb06-umon-147-233 influx_storage: ts=2020-07-20T13:58:39.437489Z lvl=info msg="Go runtime" log_id=0O789OGl000 version=go1.14 maxprocs=32
Jul 20 22:08:27 hb06-umon-147-233 influx_storage: ts=2020-07-20T14:08:27.241945Z lvl=info msg="Listening for signals" log_id=0O789OGl000
Jul 20 22:08:28 hb06-umon-147-233 influx_storage: panic: runtime error: invalid memory address or nil pointer dereference
Jul 20 22:08:28 hb06-umon-147-233 influx_storage: [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0xb8a0d9]
Jul 20 22:08:28 hb06-umon-147-233 influx_storage: goroutine 6745 [running]:
Jul 20 22:08:28 hb06-umon-147-233 influx_storage: github.com/influxdata/influxdb/tsdb/engine/tsm1.Values.Deduplicate(0xc18004ee40, 0x2, 0x2, 0xc01418b6e0, 0x451cfb, 0xc120a1f3c0)
Jul 20 22:08:28 hb06-umon-147-233 influx_storage: /data/golang/own/pkg/mod/github.com/influxdata/[email protected]/tsdb/engine/tsm1/encoding.gen.go:69 +0x69
Jul 20 22:08:28 hb06-umon-147-233 influx_storage: github.com/influxdata/influxdb/tsdb/engine/tsm1.(*entry).deduplicate(0xc14a2ea180)
Jul 20 22:08:28 hb06-umon-147-233 influx_storage: /data/golang/own/pkg/mod/github.com/influxdata/[email protected]/tsdb/engine/tsm1/cache.go:110 +0x7e
Jul 20 22:08:28 hb06-umon-147-233 influx_storage: github.com/influxdata/influxdb/tsdb/engine/tsm1.(*Cache).Deduplicate.func1(0xc120a1f3c0, 0x37, 0x40, 0xc14a2ea180, 0x37, 0x40)
Jul 20 22:08:28 hb06-umon-147-233 influx_storage: /data/golang/own/pkg/mod/github.com/influxdata/[email protected]/tsdb/engine/tsm1/cache.go:435 +0x2b
Jul 20 22:08:28 hb06-umon-147-233 influx_storage: github.com/influxdata/influxdb/tsdb/engine/tsm1.(*ring).apply.func1(0xc461fe40d0, 0xe18b40, 0xc49b84d3e0, 0xc23febfae0)
Jul 20 22:08:28 hb06-umon-147-233 influx_storage: /data/golang/own/pkg/mod/github.com/influxdata/[email protected]/tsdb/engine/tsm1/ring.go:160 +0x13e
Jul 20 22:08:28 hb06-umon-147-233 influx_storage: created by github.com/influxdata/influxdb/tsdb/engine/tsm1.(*ring).apply
Jul 20 22:08:28 hb06-umon-147-233 influx_storage: /data/golang/own/pkg/mod/github.com/influxdata/[email protected]/tsdb/engine/tsm1/ring.go:155 +0xef
Jul 20 22:08:39 hb06-umon-147-233 systemd: influx_storage.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Jul 20 22:08:39 hb06-umon-147-233 systemd: Unit influx_storage.service entered failed state.
Jul 20 22:08:39 hb06-umon-147-233 systemd: influx_storage.service failed.
Jul 20 22:08:39 hb06-umon-147-233 systemd: influx_storage.service holdoff time over, scheduling restart.
Jul 20 22:08:39 hb06-umon-147-233 systemd: Started influx_storage, a storage service for influx-galaxy.
Jul 20 22:08:39 hb06-umon-147-233 systemd: Starting influx_storage, a storage service for influx-galaxy...
Jul 20 22:08:39 hb06-umon-147-233 influx_storage: ts=2020-07-20T14:08:39.686639Z lvl=info msg="Influx Storage starting" log_id=0O78j0zl000 version=galaxy-storage-v1.0.5 branch=develop commit=a52903c
Jul 20 22:08:39 hb06-umon-147-233 influx_storage: ts=2020-07-20T14:08:39.686679Z lvl=info msg="Go runtime" log_id=0O78j0zl000 version=go1.14 maxprocs=32
Jul 20 22:17:55 hb06-umon-147-233 influx_storage: ts=2020-07-20T14:17:55.201120Z lvl=info msg="Listening for signals" log_id=0O78j0zl000
version:
influxdb 1.7.8
It happends twice:
- cacheKeyIterato.encode, tsm1/compact.go, line 1953, :
minTime, maxTime := values[0].UnixNano(), values[end-1].UnixNano()。 - Values.Deduplicate, endoding.gen.go, line 69 :
if a[i-1].UnixNano() >= a[i].UnixNano() {。
Panic wolud happend when values[i]/a[i] is nil in Values, I had checked all codes about writing Values, but i can't find a nil pointer Value which was not init by the NewXXXValue function.
I don't know why this happened...... Could anyone help me ?
@timhallinflux