Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-48376

Panic runtime error with correlated subquery (not consistent)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Neo, 7.0.2
    • Fix Version/s: Neo, 7.0.2
    • Component/s: query
    • Environment:
      7.0.2-6643
    • Triage:
      Untriaged
    • Story Points:
      1
    • Is this a Regression?:
      Unknown

      Description

      the query might not repro for 100 runs, i need to do at least 1000.

      To repro

      • create default bucket
      • uncompress lines.json.gzand import into default bucket
      • create primary index: CREATE PRIMARY INDEX `#primary` ON `default`
      • run query in a loop: SELECT meta().id, (SELECT RAW SUM(VMs.memory) FROM d.VMs AS VMs)[0] AS total FROM default d order by total

      I could repro by running at least a 1000 times.

      for n in $(seq 1000); do /opt/couchbase/bin/cbq -u Administrator -p password -script "SELECT meta().id, (SELECT RAW SUM(VMs.memory) FROM d.VMs AS VMs)[0] AS total FROM default d order by total" > /dev/null; done 

      From query.log:

      _time=2021-09-08T21:18:44.579+00:00 _level=SEVERE _msg=panic: runtime error: invalid memory address or nil pointer dereference
      _time=2021-09-08T21:18:44.579+00:00 _level=SEVERE _msg=request text: <ud>SELECT meta().id, (SELECT RAW SUM(VMs.memory) FROM d.VMs AS VMs)[0] AS total FROM default d order by total;</ud>
      _time=2021-09-08T21:18:44.579+00:00 _level=SEVERE _msg=query context: <ud></ud>
      _time=2021-09-08T21:18:44.579+00:00 _level=SEVERE _msg=stack: goroutine 13151877 [running]:
      github.com/couchbase/query/execution.(*Context).Recover(0xc00080ca00, 0xc00080cc80)
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/context.go:934 +0xbb
      panic(0x2226a40, 0x38f8800)
              /home/couchbase/.cbdepscache/exploded/x86_64/go-1.13.7/go/src/runtime/panic.go:679 +0x1b2
      github.com/couchbase/query/execution.(*base).close(0xc00080cc80, 0xc00080ca00)
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/base.go:273 +0x22a
      panic(0x2226a40, 0x38f8800)
              /home/couchbase/.cbdepscache/exploded/x86_64/go-1.13.7/go/src/runtime/panic.go:679 +0x1b2
      github.com/couchbase/query/execution.(*base).notify(0xc00080cc80)
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/base.go:988 +0x179
      panic(0x2226a40, 0x38f8800)
              /home/couchbase/.cbdepscache/exploded/x86_64/go-1.13.7/go/src/runtime/panic.go:679 +0x1b2
      github.com/couchbase/query/value.(*annotatedValue).WriteJSON(0xc004213050, 0x27b2e80, 0xc00092ee70, 0x2513032, 0x4, 0x2513032, 0x4, 0xc003f52f00, 0xc0012ddaa8, 0x11aab2e)
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/value/annotated.go:136 +0x2d
      github.com/couchbase/query/server/http.(*httpRequest).Result(0xc0009f0000, 0x2859020, 0xc004213050, 0xc0009f0000)
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/server/http/service_response.go:264 +0x214
      github.com/couchbase/query/execution.result(0xc00080ca00, 0x2859020, 0xc004213050, 0xbebc4f607f54)
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/context.go:556 +0x51
      github.com/couchbase/query/execution.(*Context).Result(...)
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/context.go:560
      github.com/couchbase/query/execution.(*Stream).processItem(0xc000a44900, 0x2859020, 0xc004213050, 0xc00080ca00, 0xc0012ddc01)
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/stream.go:70 +0x4a
      github.com/couchbase/query/execution.serializedSend(0xc00080cc80, 0x2836800, 0xc000a44900, 0x2859020, 0xc004213050, 0x1)
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/base.go:936 +0x137
      github.com/couchbase/query/execution.(*base).sendItemOp(0xc00080cc80, 0x2836800, 0xc000a44900, 0x2859020, 0xc004213050, 0x1cb5b01)
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/base.go:701 +0x67 

      See attached query.log

      Not clear if this is a regression.

        Attachments

        1. lines.json.gz
          452 kB
        2. query.log
          407 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

          Hide
          marco.greco Marco Greco added a comment -

          D'oh! Very good point!

          Show
          marco.greco Marco Greco added a comment - D'oh! Very good point!
          Hide
          Donald.haggart Donald Haggart added a comment -

          n1ql_thr_JOIN_Q26_100M_1K_100K_plasma_ok_avg_query_requests_arke

          Without change:

          http://perf.jenkins.couchbase.com/job/arke-multi-client/5213

          "value": 13.0

          With change:

          http://perf.jenkins.couchbase.com/job/arke-multi-client/5336

          "value": 15.0

          so probably good to go.

          Show
          Donald.haggart Donald Haggart added a comment - n1ql_thr_JOIN_Q26_100M_1K_100K_plasma_ok_avg_query_requests_arke Without change: http://perf.jenkins.couchbase.com/job/arke-multi-client/5213 "value": 13.0 With change: http://perf.jenkins.couchbase.com/job/arke-multi-client/5336 "value": 15.0 so probably good to go.
          Hide
          build-team Couchbase Build Team added a comment -

          Build couchbase-server-7.0.2-6675 contains query commit 435cec6 with commit message:
          MB-48376 Restore stashed tracking after subquery completion.

          Show
          build-team Couchbase Build Team added a comment - Build couchbase-server-7.0.2-6675 contains query commit 435cec6 with commit message: MB-48376 Restore stashed tracking after subquery completion.
          Hide
          build-team Couchbase Build Team added a comment -

          Build couchbase-server-7.1.0-1294 contains query commit f4e000c with commit message:
          MB-48376 Restore stashed tracking after sub-query completes

          Show
          build-team Couchbase Build Team added a comment - Build couchbase-server-7.1.0-1294 contains query commit f4e000c with commit message: MB-48376 Restore stashed tracking after sub-query completes
          Hide
          pierre.regazzoni Pierre Regazzoni added a comment -

          Verified using repro steps (run 1000 times) on 7.0.2-6675 and 7.1.0-1294

          Show
          pierre.regazzoni Pierre Regazzoni added a comment - Verified using repro steps (run 1000 times) on 7.0.2-6675 and 7.1.0-1294

            People

            Assignee:
            pierre.regazzoni Pierre Regazzoni
            Reporter:
            pierre.regazzoni Pierre Regazzoni
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes

                  PagerDuty