influxdb icon indicating copy to clipboard operation
influxdb copied to clipboard

Panic on deduplicate

Open semihalev opened this issue 9 years ago • 12 comments

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

semihalev avatar Oct 09 '17 17:10 semihalev

Can you attach the full trace?

jwilder avatar Oct 16 '17 15:10 jwilder

@semihalev unfortunately without more information we'll struggle to fix this. Do you have a longer stack trace?

e-dard avatar Oct 20 '17 13:10 e-dard

@jwilder @e-dard

I'm so sorry, I missed your messages. I attached full trace log.

OS: Linux Version: 1.3.6

trace.log

semihalev avatar Nov 23 '17 09:11 semihalev

@semihalev are you still seeing this happen? Can you try updating to 1.4.2?

e-dard avatar Nov 23 '17 11:11 e-dard

I updated to 1.4.2, I will check and inform you again.

semihalev avatar Nov 23 '17 11:11 semihalev

Panic happened 5 times on 1.4.2, it's same error. I attached panic log before. Could you please check it?

semihalev avatar Dec 13 '17 17:12 semihalev

@semihalev -- a fix was pushed for this item in Jan. Have you been able to reproduce using 1.5.1?

timhallinflux avatar Mar 29 '18 17:03 timhallinflux

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.

stale[bot] avatar Jul 24 '19 07:07 stale[bot]

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.

stale[bot] avatar Jul 31 '19 08:07 stale[bot]

:+1

xinyu7git avatar Jul 22 '20 09:07 xinyu7git

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:

  1. cacheKeyIterato.encode, tsm1/compact.go, line 1953, : minTime, maxTime := values[0].UnixNano(), values[end-1].UnixNano() 。
  2. 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 ?

xinyu7git avatar Jul 22 '20 09:07 xinyu7git

@timhallinflux

xinyu7git avatar Jul 22 '20 10:07 xinyu7git