influxdata / influxdata/influxdb

influxdb panics, bringing down server

Open
#23,856 2 comments 1 reaction 0 assignees View on GitHub
kind/bug
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

__Steps to reproduce:__
List the minimal actions needed to reproduce the behavior.

1. After x amount of attempts to connect to /ready Influx restarts

__Expected behavior:__
Not to have restarts every few hours.

__Actual behavior:__
Restarts every few hours when influx cannot reach itself at /ready

__Environment info:__

* System info: Linux 5.4.0-124-generic x86_64
* InfluxDB version: InfluxDB v2.4.0 (git: de247bab08) build_date: 2022-08-18T19:41:15Z
* Other relevant environment details: Physical server. 252GB RAM; 56 CPU; 2TB SSD dedicated to /var/lib/influxdb

__Config:__
N/A

__Logs:__
```Nov 3 08:47:10 ip-10-2-0-14 influxd-systemd-start.sh[772115]: unexpected fault address 0x10c2b0341228
Nov 3 11:15:34 ip-10-2-0-14 influxd-systemd-start.sh[785112]: fatal error: unexpected signal during runtime execution
Nov 3 11:47:14 ip-10-2-0-14 influxd-systemd-start.sh[785767]: fatal error: unexpected signal during runtime execution
Nov 3 11:47:30 ip-10-2-0-14 influxd-systemd-start.sh[786130]: fatal error: unexpected signal during runtime execution
Nov 3 13:33:21 ip-10-2-0-14 influxd-systemd-start.sh[786460]: fatal error: unexpected signal during runtime execution
Nov 3 14:46:22 ip-10-2-0-14 influxd-systemd-start.sh[787000]: fatal error: unexpected signal during runtime execution
Nov 3 14:46:27 ip-10-2-0-14 influxd-systemd-start.sh[787403]: unexpected fault address 0x10c01d84b000
```

```
Nov 3 14:47:54 ip-10-2-0-14 influxd-systemd-start.sh[787400]: InfluxDB API at http://localhost:8086/ready unavailable after 89 attempts...
Nov 3 14:47:55 ip-10-2-0-14 systemd[1]: Failed to start InfluxDB is an open-source, distributed, time series database.
Nov 3 14:47:55 ip-10-2-0-14 systemd[1]: Stopped InfluxDB is an open-source, distributed, time series database.
Nov 3 14:47:55 ip-10-2-0-14 systemd[1]: Starting InfluxDB is an open-source, distributed, time series database...
Nov 3 14:47:55 ip-10-2-0-14 influxd-systemd-start.sh[787944]: ts=2022-11-03T14:47:55.630159Z lvl=info msg="Welcome to InfluxDB" log_id=0dwVFZwG000 version=v2.4.0 commit=de247bab08 build_date=2022-08-18T19:41:15Z log_level=info
Nov 3 14:47:55 ip-10-2-0-14 influxd-systemd-start.sh[787944]: ts=2022-11-03T14:47:55.637200Z lvl=info msg="Checking InfluxDB metadata for prior version." log_id=0dwVFZwG000 bolt_path=/var/lib/influxdb/influxd.bolt
Nov 3 14:47:55 ip-10-2-0-14 influxd-systemd-start.sh[787942]: InfluxDB API at http://localhost:8086/ready unavailable after 1 attempts...
Nov 3 14:47:56 ip-10-2-0-14 influxd-systemd-start.sh[787942]: InfluxDB API at http://localhost:8086/ready unavailable after 2 attempts...
Nov 3 14:47:57 ip-10-2-0-14 influxd-systemd-start.sh[787942]: InfluxDB API at http://localhost:8086/ready unavailable after 3 attempts...
Nov 3 14:47:58 ip-10-2-0-14 influxd-systemd-start.sh[787942]: InfluxDB API at http://localhost:8086/ready unavailable after 4 attempts...
Nov 3 14:47:59 ip-10-2-0-14 influxd-systemd-start.sh[787942]: InfluxDB API at http://localhost:8086/ready unavailable after 5 attempts...
Nov 3 14:48:00 ip-10-2-0-14 influxd-systemd-start.sh[787942]: InfluxDB API at http://localhost:8086/ready unavailable after 6 attempts...
Nov 3 14:48:01 ip-10-2-0-14 influxd-systemd-start.sh[787942]: InfluxDB API at http://localhost:8086/ready unavailable after 7 attempts...
Nov 3 14:48:02 ip-10-2-0-14 influxd-systemd-start.sh[787942]: InfluxDB API at http://localhost:8086/ready unavailable after 8 attempts...
Nov 3 14:48:03 ip-10-2-0-14 influxd-systemd-start.sh[787942]: InfluxDB API at http://localhost:8086/ready unavailable after 9 attempts...
Nov 3 14:48:04 ip-10-2-0-14 influxd-systemd-start.sh[787942]: InfluxDB API at http://localhost:8086/ready unavailable after 10 attempts...
Nov 3 14:48:05 ip-10-2-0-14 influxd-systemd-start.sh[787942]: InfluxDB API at http://localhost:8086/ready unavailable after 11 attempts...
Nov 3 14:48:06 ip-10-2-0-14 influxd-systemd-start.sh[787942]: InfluxDB started
```
```
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: unexpected fault address 0x10c3ce600108
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: fatal error: fault
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x10c3ce600108 pc=0x7f3f517900c0]
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: goroutine 23066845 [running]:
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: runtime.throw({0x7f3f536a2edc?, 0x7eba1c8e1448?})
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/go/src/runtime/panic.go:992 +0x71 fp=0xc3bf0e8ca0 sp=0xc3bf0e8c70 pc=0x7f3f5175bd71
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: runtime.sigpanic()
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/go/src/runtime/signal_unix.go:825 +0x2ec fp=0xc3bf0e8cf0 sp=0xc3bf0e8ca0 pc=0x7f3f51771fcc
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: runtime.memclrNoHeapPointers()
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/go/src/runtime/memclr_amd64.s:163 +0x240 fp=0xc3bf0e8cf8 sp=0xc3bf0e8cf0 pc=0x7f3f517900c0
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: runtime.growslice(0xc3bf0e8db0?, {0xc3ce474d00?, 0xc3bf0e8e68?, 0x7f3f523c2ab3?}, 0x7f3f5470a360?)
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/go/src/runtime/slice.go:275 +0x4c9 fp=0xc3bf0e8d60 sp=0xc3bf0e8cf8 pc=0x7f3f51773969
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: github.com/influxdata/influxdb/v2/tsdb/engine/tsm1.FloatArrayDecodeAll({0x7eba62be686d?, 0x1ed?, 0x31a36c5?}, {0x0, 0x0, 0x0})
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/root/project/tsdb/engine/tsm1/batch_float.go:507 +0x3e5 fp=0xc3bf0e8e00 sp=0xc3bf0e8d60 pc=0x7f3f524b95c5
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: github.com/influxdata/influxdb/v2/tsdb/engine/tsm1.DecodeFloatArrayBlock({0x7eba62be6860?, 0xc3bf0e8f28?, 0x0?}, 0xc3bf0e8f28)
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/root/project/tsdb/engine/tsm1/array_encoding.go:47 +0xe5 fp=0xc3bf0e8e78 sp=0xc3bf0e8e00 pc=0x7f3f524b76a5
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: github.com/influxdata/influxdb/v2/tsdb/engine/tsm1.(*tsmBatchKeyIterator).combineFloat(0xc2ff5218c0, 0xd8?)
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/root/project/tsdb/engine/tsm1/compact.gen.go:1188 +0x3f2 fp=0xc3bf0e8f98 sp=0xc3bf0e8e78 pc=0x7f3f524c25f2
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: github.com/influxdata/influxdb/v2/tsdb/engine/tsm1.(*tsmBatchKeyIterator).mergeFloat(0xc2ff5218c0)
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/root/project/tsdb/engine/tsm1/compact.gen.go:1059 +0x125 fp=0xc3bf0e8fc0 sp=0xc3bf0e8f98 pc=0x7f3f524c2125
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: github.com/influxdata/influxdb/v2/tsdb/engine/tsm1.(*tsmBatchKeyIterator).merge(0x7f3f546d3320?)
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/root/project/tsdb/engine/tsm1/compact.go:1882 +0x2e fp=0xc3bf0e9048 sp=0xc3bf0e8fc0 pc=0x7f3f524d25ee
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: github.com/influxdata/influxdb/v2/tsdb/engine/tsm1.(*tsmBatchKeyIterator).Next(0xc2ff5218c0)
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/root/project/tsdb/engine/tsm1/compact.go:1867 +0x295 fp=0xc3bf0e9230 sp=0xc3bf0e9048 pc=0x7f3f524d1515
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: github.com/influxdata/influxdb/v2/tsdb/engine/tsm1.(*Compactor).write(0xc09a8f5830, {0xc01155d2c0, 0x57}, {0x7f3f549c89a8, 0xc2ff5218c0}, 0x1, 0x2?)
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/root/project/tsdb/engine/tsm1/compact.go:1157 +0x382 fp=0xc3bf0e9478 sp=0xc3bf0e9230 pc=0x7f3f524cf9a2
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: github.com/influxdata/influxdb/v2/tsdb/engine/tsm1.(*Compactor).writeNewFiles(0xc09a8f5830, 0x4?, 0x3e8?, {0xc363500c00?, 0x4, 0xc00d9d3f80?}, {0x7f3f549c89a8, 0xc2ff5218c0}, 0x4?, 0xc3252e2f00)
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/root/project/tsdb/engine/tsm1/compact.go:1059 +0x35e fp=0xc3bf0e9670 sp=0xc3bf0e9478 pc=0x7f3f524cf0de
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: github.com/influxdata/influxdb/v2/tsdb/engine/tsm1.(*Compactor).compact(0xc09a8f5830, 0x0?, {0xc363500c00?, 0x4, 0x4}, 0xc0c94d19d5c82489?)
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/root/project/tsdb/engine/tsm1/compact.go:966 +0x285 fp=0xc3bf0e9790 sp=0xc3bf0e9670 pc=0x7f3f524cdb45
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: github.com/influxdata/influxdb/v2/tsdb/engine/tsm1.(*Compactor).CompactFull(0xc09a8f5830, {0xc363500c00, 0x4, 0x4}, 0x2?)
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/root/project/tsdb/engine/tsm1/compact.go:984 +0x1c7 fp=0xc3bf0e9878 sp=0xc3bf0e9790 pc=0x7f3f524ce347
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: github.com/influxdata/influxdb/v2/tsdb/engine/tsm1.(*compactionStrategy).compactGroup(0xc3252c0690)
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/root/project/tsdb/engine/tsm1/engine.go:2172 +0x205 fp=0xc3bf0e9f08 sp=0xc3bf0e9878 pc=0x7f3f524f6fe5
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: github.com/influxdata/influxdb/v2/tsdb/engine/tsm1.(*compactionStrategy).Apply(0xc3252c0690)
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/root/project/tsdb/engine/tsm1/engine.go:2150 +0x3e fp=0xc3bf0e9f48 sp=0xc3bf0e9f08 pc=0x7f3f524f6d3e
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: github.com/influxdata/influxdb/v2/tsdb/engine/tsm1.(*Engine).compactLevel.func1()
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/root/project/tsdb/engine/tsm1/engine.go:2088 +0xe5 fp=0xc3bf0e9fe0 sp=0xc3bf0e9f48 pc=0x7f3f524f6585
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: runtime.goexit()
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/go/src/runtime/asm_amd64.s:1571 +0x1 fp=0xc3bf0e9fe8 sp=0xc3bf0e9fe0 pc=0x7f3f5178f2c1
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: created by github.com/influxdata/influxdb/v2/tsdb/engine/tsm1.(*Engine).compactLevel
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/root/project/tsdb/engine/tsm1/engine.go:2080 +0x185
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: goroutine 1 [chan receive, 314 minutes]:
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: github.com/influxdata/influxdb/v2/cmd/influxd/launcher.cmdRunE.func1()
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/root/project/cmd/influxd/launcher/cmd.go:127 +0x317
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: github.com/influxdata/influxdb/v2/kit/cli.NewCommand.func1(0xc00016bb80?, {0x7f3f59f013c8?, 0x0?, 0x0?})
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/root/project/kit/cli/viper.go:54 +0x1e
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: github.com/spf13/cobra.(*Command).execute(0xc00016bb80, {0xc00004e230, 0x0, 0x0})
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:842 +0x67c
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: github.com/spf13/cobra.(*Command).ExecuteC(0xc00016bb80)
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950 +0x39c
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: github.com/spf13/cobra.(*Command).Execute(...)
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: main.main()
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/root/project/cmd/influxd/main.go:61 +0x4b8
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: goroutine 55 [select]:
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: go.opencensus.io/stats/view.(*worker).start(0xc000237300)
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/go/pkg/mod/go.opencensus.io@v0.23.0/stats/view/worker.go:276 +0xad
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: created by go.opencensus.io/stats/view.init.0
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/go/pkg/mod/go.opencensus.io@v0.23.0/stats/view/worker.go:34 +0x8d
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: goroutine 57 [syscall, 314 minutes]:
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: os/signal.signal_recv()
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/go/src/runtime/sigqueue.go:151 +0x2f
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: os/signal.loop()
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/go/src/os/signal/signal_unix.go:23 +0x19
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: created by os/signal.Notify.func1.1
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/go/src/os/signal/signal.go:151 +0x2a
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: goroutine 58 [select, 314 minutes]:
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: github.com/influxdata/influxdb/v2/kit/signals.WithSignals.func1()
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/root/project/kit/signals/context.go:17 +0x87
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: created by github.com/influxdata/influxdb/v2/kit/signals.WithSignals
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/root/project/kit/signals/context.go:15 +0xfb
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: goroutine 60 [select, 19 minutes]:
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: github.com/influxdata/influxdb/v2/bolt.(*pluginMetricsCollector).pollTelegrafStats(0xc000222930, 0xc00218f8c0?)
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/root/project/bolt/metrics.go:123 +0x76
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: created by github.com/influxdata/influxdb/v2/bolt.(*pluginMetricsCollector).Open
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/root/project/bolt/metrics.go:118 +0x72
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: goroutine 62 [select, 314 minutes]:
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: database/sql.(*DB).connectionOpener(0xc00090fc70, {0x7f3f549c0e28, 0xc001030b00})
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/go/src/database/sql/sql.go:1226 +0x8d
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: created by database/sql.OpenDB
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/go/src/database/sql/sql.go:794 +0x18d
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: goroutine 1305 [select, 14 minutes]:
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: github.com/influxdata/influxdb/v2/tsdb/index/tsi1.(*Partition).runPeriodicCompaction(0xc00744e6c0)
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/root/project/tsdb/index/tsi1/partition.go:957 +0x11a
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: created by github.com/influxdata/influxdb/v2/tsdb/index/tsi1.(*Partition).Open
Oct 11 00:46:32 ip-10-2-0-14 influxd-systemd-start.sh[535994]: #011/root/project/tsdb/index/tsi1/partition.go:254 +0x8bc
```

Contributor guide

Open the contributing guide

Research direction

Start with the panic path in tsdb/engine/tsm1/batch_float.go at FloatArrayDecodeAll, then follow array_encoding.go, compact.gen.go, compact.go, and engine.go through compaction. Reproduce the /ready-triggered restart if possible and determine why the compaction path reaches the fatal fault; done means InfluxDB no longer panics or restarts during this behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, linux
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.