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

order by operator may still sort even if it has been stopped

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 4.6.4, 5.1.0, 5.5.0
    • 4.0.0, 4.1.0, 4.5.0, 4.5.1, 4.6.0, 4.6.1, 4.6.2, 4.6.3, 5.0.0
    • query
    • Untriaged
    • No

    Description

      The order by operator will still proceed with a sort even if it has been stopped, leading to crashes trying to access sort terms that have already been garbage collected, like so

      panic: runtime error: index out of range
              panic: send on closed channel
       
      goroutine 1782431 [running]:
      runtime.gopanic(0xc7a520, 0xc23aa288e0)
              /usr/local/go/src/runtime/panic.go:425 +0x2a3 fp=0xc20cd1eb30 sp=0xc20cd1eac8
      runtime.chansend(0xc7bc20, 0xc231cea000, 0xc20cd1ec2f, 0xc23aa28801, 0xadfa5a, 0xc20cd1ec30)
              /usr/local/go/src/runtime/chan.go:131 +0x1a3 fp=0xc20cd1ebd8 sp=0xc20cd1eb30
      runtime.chansend1(0xc7bc20, 0xc231cea000, 0xc20cd1ec2f)
              /usr/local/go/src/runtime/chan.go:68 +0x43 fp=0xc20cd1ec10 sp=0xc20cd1ebd8
      github.com/couchbase/query/sort.notify(0xc231cea000)
              /home/couchbase/jenkins/workspace/watson-unix/goproj/src/github.com/couchbase/query/sort/sort.go:214 +0x4a fp=0xc20cd1ec38 sp=0xc20cd1ec10
      runtime.call16(0x1405880, 0xc242003e30, 0x800000008)
              /usr/local/go/src/runtime/asm_amd64.s:401 +0x45 fp=0xc20cd1ec50 sp=0xc20cd1ec38
      runtime.gopanic(0xf46f40, 0xc20802a000)
              /usr/local/go/src/runtime/panic.go:387 +0x3a8 fp=0xc20cd1ecb8 sp=0xc20cd1ec50
      runtime.panicindex()
              /usr/local/go/src/runtime/panic.go:12 +0x4e fp=0xc20cd1ece0 sp=0xc20cd1ecb8
      github.com/couchbase/query/execution.(*Order).lessThan(0xc208cd4700, 0x7fcdd5c730f8, 0xc244d65b60, 0x7fcdd5c730f8, 0xc251157ad0, 0x1)
              /home/couchbase/jenkins/workspace/watson-unix/goproj/src/github.com/couchbase/query/execution/order.go:125 +0x85a fp=0xc20cd1eea0 sp=0xc20cd1ece0
      github.com/couchbase/query/execution.(*Order).Less(0xc208cd4700, 0x22b, 0x1fc, 0x201)
              /home/couchbase/jenkins/workspace/watson-unix/goproj/src/github.com/couchbase/query/execution/order.go:116 +0xab fp=0xc20cd1eef0 sp=0xc20cd1eea0
      github.com/couchbase/query/sort.doPivot(0x7fcdcc1af920, 0xc208cd4700, 0x1fc, 0x29a, 0xb, 0x0)
              /home/couchbase/jenkins/workspace/watson-unix/goproj/src/github.com/couchbase/query/sort/sort.go:119 +0x1d4 fp=0xc20cd1ef58 sp=0xc20cd1eef0
      github.com/couchbase/query/sort.quickSort(0x7fcdcc1af920, 0xc208cd4700, 0x1fc, 0x29a, 0x10, 0xc231cea000)
              /home/couchbase/jenkins/workspace/watson-unix/goproj/src/github.com/couchbase/query/sort/sort.go:179 +0x13b fp=0xc20cd1efb0 sp=0xc20cd1ef58
      runtime.goexit()
              /usr/local/go/src/runtime/asm_amd64.s:2232 +0x1 fp=0xc20cd1efb8 sp=0xc20cd1efb0
      created by github.com/couchbase/query/sort.quickSort
              /home/couchbase/jenkins/workspace/watson-unix/goproj/src/github.com/couchbase/query/sort/sort.go:193 +0x248
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Prerna.Manaktala Prerna Manaktala (Inactive)
            marco.greco Marco Greco (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty