m3 icon indicating copy to clipboard operation
m3 copied to clipboard

Panic in query service

Open Nexucis opened this issue 7 years ago • 2 comments

Hello,

I'm currently using m3db with m3coordinator in a single node. (using m3db v0.8.1)

Sometimes when I query the node using Grafana the node crashed with the following panic stack trace:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x627de8]

goroutine 168400920 [running]:
container/list.(*List).remove(...)
        /usr/local/go/src/container/list/list.go:111
container/list.(*List).MoveToFront(0xc422ab4060, 0xc45d8e6e70)
        /usr/local/go/src/container/list/list.go:173 +0x68
github.com/m3db/m3/src/query/storage.(*QueryConversionLRU).Get(0xc422bae020, 0xc674951030, 0x61, 0x61, 0x36, 0x40, 0x0)
        /go/src/github.com/m3db/m3/src/query/storage/query_conversion_lru.go:84 +0x80
github.com/m3db/m3/src/query/storage.(*QueryConversionCache).get(0xc422bae040, 0xc674951030, 0x61, 0x61, 0x61, 0x61, 0x0)
        /go/src/github.com/m3db/m3/src/query/storage/index.go:52 +0x4d
github.com/m3db/m3/src/query/storage.FetchQueryToM3Query(0xc6700ea780, 0xc422bae040, 0x0, 0x17e5200, 0x16ab801, 0xc5ea3d35c0)
        /go/src/github.com/m3db/m3/src/query/storage/index.go:179 +0xd5
github.com/m3db/m3/src/query/storage/m3.(*m3storage).fetchCompressed(0xc42059eaf0, 0x1a90240, 0xc5ea3d3980, 0xc6700ea780, 0xc64c45b000, 0x410139, 0xc6db6a9ba0, 0x10, 0x10)
        /go/src/github.com/m3db/m3/src/query/storage/m3/storage.go:232 +0x88
github.com/m3db/m3/src/query/storage/m3.(*m3storage).FetchCompressed(0xc42059eaf0, 0x1a90240, 0xc5ea3d3980, 0xc6700ea780, 0xc64c45b000, 0x16ab801, 0xc5ea3d3980, 0xc503078b00, 0x441447, 0x10)
        /go/src/github.com/m3db/m3/src/query/storage/m3/storage.go:205 +0x69
github.com/m3db/m3/src/query/storage/m3.(*m3storage).FetchBlocks(0xc42059eaf0, 0x1a90240, 0xc5ea3d3980, 0xc6700ea780, 0xc64c45b000, 0xc6700ea780, 0xc6db6a9ba0, 0x1, 0x1, 0x0)
        /go/src/github.com/m3db/m3/src/query/storage/m3/storage.go:160 +0xa4
github.com/m3db/m3/src/query/storage/fanout.(*fanoutStorage).FetchBlocks(0xc45c624c60, 0x1a90240, 0xc5ea3d3980, 0xc6700ea780, 0xc64c45b000, 0x1, 0x1, 0x1aa5a40, 0x24ddbc8, 0x1a90240)
        /go/src/github.com/m3db/m3/src/query/storage/fanout/storage.go:87 +0x186
github.com/m3db/m3/src/query/functions.(*FetchNode).fetch(0xc4d7131a20, 0xc5ea3d3950, 0x0, 0x0, 0x0, 0x0, 0x0)
        /go/src/github.com/m3db/m3/src/query/functions/fetch.go:106 +0x357
github.com/m3db/m3/src/query/functions.(*FetchNode).Execute(0xc4d7131a20, 0xc5ea3d3950, 0x455d30, 0xc49819ec00)
        /go/src/github.com/m3db/m3/src/query/functions/fetch.go:117 +0x67
github.com/m3db/m3/src/query/executor.sourceRequest.Process(0x1a73180, 0xc4d7131a20, 0xc5ea3d38f0, 0x1a90180, 0xc64c45af80, 0x4, 0xc608d52480)
        /go/src/github.com/m3db/m3/src/query/executor/state.go:212 +0x46
github.com/m3db/m3/src/query/util/execution.processParallel.func1(0xc600000008, 0x19a41e0)
        /go/src/github.com/m3db/m3/src/query/util/execution/parallel.go:57 +0x44
github.com/m3db/m3/vendor/golang.org/x/sync/errgroup.(*Group).Go.func1(0xc64c45afc0, 0xc66a0663e0)
        /go/src/github.com/m3db/m3/vendor/golang.org/x/sync/errgroup/errgroup.go:57 +0x57
created by github.com/m3db/m3/vendor/golang.org/x/sync/errgroup.(*Group).Go
        /go/src/github.com/m3db/m3/vendor/golang.org/x/sync/errgroup/errgroup.go:54 +0x66

For the moment I didn't see how I can reproduce it, the problem seems to appear randomly

Note for who has the same problem:

Following the discussion from gitter, having the coordinator and the dbNode in two different container will avoid to see the db crashed when the queryer panics.

M3DBNode configMap

- apiVersion: v1
  kind: ConfigMap
  metadata:
    name: m3dbnode-config
    namespace: my-namespace
  data:
    m3dbnode.yml: |+
      coordinator:
        listenAddress:
          type: "config"
          value: "0.0.0.0:7201"
        local:
          namespaces:
              - namespace: default
                type: unaggregated
                retention: 48h
        metrics:
          scope:
            prefix: "coordinator"
          prometheus:
            handlerPath: /metrics
            listenAddress: 0.0.0.0:7203
          sanitization: prometheus
          samplingRate: 1.0
          extended: none
        tagOptions:
          idScheme: quoted

      db:
        logging:
          level: info

        metrics:
          prometheus:
            handlerPath: /metrics
          sanitization: prometheus
          samplingRate: 1.0
          extended: detailed

        listenAddress: 0.0.0.0:9000
        clusterListenAddress: 0.0.0.0:9001
        httpNodeListenAddress: 0.0.0.0:9002
        httpClusterListenAddress: 0.0.0.0:9003
        debugListenAddress: 0.0.0.0:9004

        hostID:
          resolver: hostname

        client:
          writeConsistencyLevel: majority
          readConsistencyLevel: unstrict_majority

        gcPercentage: 100

        writeNewSeriesAsync: true
        writeNewSeriesLimitPerSecond: 1048576
        writeNewSeriesBackoffDuration: 2ms

        bootstrap:
          bootstrappers:
              - filesystem
              - commitlog
              - peers
              - uninitialized_topology
          fs:
              numProcessorsPerCPU: 0.125

        cache:
          series:
            policy: lru
          postingsList:
            size: 262144

        commitlog:
          flushMaxBytes: 524288
          flushEvery: 1s
          queue:
              calculationType: fixed
              size: 2097152

        fs:
          filePathPrefix: /var/lib/m3db

        config:
          service:
              env: default_env
              zone: embedded
              service: m3db
              cacheDir: /var/lib/m3kv
              etcdClusters:
              - zone: embedded
                endpoints:
                - http://etcd-0.etcd:2379
                - http://etcd-1.etcd:2379
                - http://etcd-2.etcd:2379

Nexucis avatar Apr 10 '19 14:04 Nexucis

Should be resolved with https://github.com/m3db/m3/pull/1546. Will put out a release tomorrow. Thanks for bearing with us!

benraskin92 avatar Apr 11 '19 01:04 benraskin92

This is fixed in https://github.com/m3db/m3/releases/tag/v0.8.2

benraskin92 avatar Apr 11 '19 20:04 benraskin92