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

Query: panic during window function query execution

    XMLWordPrintable

Details

    Description

      build 6.5.0-4821

      Steps to reproduce:

      1. load standard `travel-sample` bucket
      2. run those updates:

      update `travel-sample` set num_value=null where id=465 and type='airport';
      update `travel-sample` set num_value=0 where id=466 and type='airport';
      update `travel-sample` set num_value=1 where id=467 and type='airport';
      update `travel-sample` set num_value=2 where id=468 and type='airport';
      update `travel-sample` set num_value=3 where id=469 and type='airport';
      update `travel-sample` set num_value=4 where id=470 and type='airport';
      update `travel-sample` set num_value=5 where id=471 and type='airport';
      update `travel-sample` set num_value=6 where id=472 and type='airport';
      update `travel-sample` set num_value=7 where id=474 and type='airport';
      update `travel-sample` set num_value=8 where id=475 and type='airport';
      update `travel-sample` set num_value=9 where id=476 and type='airport';
      update `travel-sample` set num_value=10 where id=477 and type='airport';
      

      1. run query:

      select num_value, ratio_to_report(num_value) over(order by num_value ROWS BETWEEN 2 PRECEDING AND UNBOUNDED FOLLOWING) from `travel-sample` 
      where type='airport' and id in [465,466,467,468,469,470,471,472,474,475,476,477] order by num_value
      

      response is:

      [
        {
          "code": 5001,
          "msg": "Panic: runtime error: index out of range"
        }
      ]
      

      query.log fragments:

      query.log-2019-11-19T12:42:28.670-08:00 [Info] GSIC[default/travel-sample-1574183299680791209] request(893a4067-07aa-4cd5-9608-8db11853ad58) removing temp file /opt/couchbase/var/lib/couchbase/tmp/scan-results7065665090546 ...query.log-2019-11-19T12:42:28.670-08:00 [Info] GSIC[default/travel-sample-1574183299680791209] request(893a4067-07aa-4cd5-9608-8db11853ad58) removing temp file /opt/couchbase/var/lib/couchbase/tmp/scan-results7065665090546 ...query.log-2019-11-19T12:42:32.447-08:00 [Info] serviceChangeNotifier: received PoolChangeNotificationquery.log-2019-11-19T12:42:32.465-08:00 [Info] Refreshing indexer list due to cluster changes or auto-refresh.query.log-2019-11-19T12:42:32.465-08:00 [Info] Refreshed Indexer List: [127.0.0.1:9100]query.log-2019-11-19T12:42:32.467-08:00 [Info] switched currmeta from 61 -> 61 force truequery.log-2019-11-19T12:42:33.718-08:00 [Info] [Queryport-connpool:127.0.0.1:9101] active conns 0, free conns 2query.log-2019-11-19T12:42:50.112-08:00 [INFO]  Trying with http://127.0.0.1:8091/pools/default/bucketsStreaming/travel-samplequery.log-2019-11-19T12:42:50.117-08:00 [INFO] Got new configuration for bucket travel-samplequery.log-2019-11-19T12:43:02.962-08:00 [Info] GSIC[default/travel-sample-1574183299680791209] 0a01e6d4-a5d2-4486-b2fc-f641b2ffb206 new temp file ... /opt/couchbase/var/lib/couchbase/tmp/scan-results7065969669801query.log-2019-11-19T12:43:03.068-08:00 [Info] GSIC[default/travel-sample-1574183299680791209] request(0a01e6d4-a5d2-4486-b2fc-f641b2ffb206) removing temp file /opt/couchbase/var/lib/couchbase/tmp/scan-results7065969669801 ...query.log:_time=2019-11-19T12:43:03.203-08:00 _level=SEVERE _msg=panic: runtime error: index out of rangequery.log-_time=2019-11-19T12:43:03.203-08:00 _level=SEVERE _msg=request text: <ud>select num_value, ratio_to_report(num_value) over(order by num_value ROWS BETWEEN 2 PRECEDING AND UNBOUNDED FOLLOWING) from `travel-sample`query.log-where type='airport' and id in [465,466,467,468,469,470,471,472,474,475,476,477] order by num_valuequery.log-query.log-/*update `travel-sample` set num_value=10 where id=477 and type='airport'*/query.log-/*SELECT META().id,query.log-       country,query.log-       city,query.log-       NTH_VALUE(city, 10) respect NULLS OVER (PARTITION BY country ORDER BY city desc range between unbounded preceding and unbounded following )query.log-FROM `travel-sample`query.log-WHERE type='airport'query.log-ORDER BY country asc,query.log-         city ascquery.log-*/query.log-query.log-         /*and meta().id='airport_1291'*/ /*update `travel-sample` set city=null where country='France' and city='Abbeville' and type='airport'*/ /*select * from `travel-sample` where meta().id='airport_1291'*/</ud>query.log-_time=2019-11-19T12:43:03.203-08:00 _level=SEVERE _msg=stack: goroutine 256231 [running]:query.log-github.com/couchbase/query/execution.(*Context).Recover(0xc00283ea80, 0xc0008be900)query.log- /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/context.go:633 +0xbcquery.log:panic(0x1ca7620, 0x310e4d0)query.log: /home/couchbase/.cbdepscache/exploded/x86_64/go-1.11.4/go/src/runtime/panic.go:513 +0x1b9query.log-github.com/couchbase/query/execution.(*AggregateInfo).evaluatePreAggregate(0xc000b9d040, 0xc0008be900, 0xc003bcc080, 0x0, 0x0, 0x0)query.log- /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/window.go:339 +0x3a5query.log-github.com/couchbase/query/execution.(*WindowAggregate).processWindowAggregates(0xc0008be900, 0x0, 0x2120740, 0xc002568aa0, 0x0)query.log- /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/window.go:1145 +0x2bequery.log-github.com/couchbase/query/execution.(*WindowAggregate).afterWindowPartition(0xc0008be900, 0x1841f01, 0xc001902200)query.log- /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/window.go:1117 +0x170query.log-github.com/couchbase/query/execution.(*WindowAggregate).afterItems(0xc0008be900, 0xc00283ea80)query.log- /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/window.go:1007 +0x30query.log-github.com/couchbase/query/execution.(*base).runConsumer.func1()query.log- /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/base.go:670 +0x275--query.log-github.com/couchbase/query/execution.(*base).runConsumer(0xc0008be900, 0x20d29e0, 0xc0008be900, 0xc00283ea80, 0x0, 0x0)query.log- /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/base.go:613 +0xa2query.log-github.com/couchbase/query/execution.(*WindowAggregate).RunOnce(0xc0008be900, 0xc00283ea80, 0x0, 0x0)query.log- /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/window.go:961 +0x86query.log-created by github.com/couchbase/query/execution.(*Sequence).RunOnce.func1query.log- /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/sequence.go:117 +0x407query.log-query.log-goroutine 256231 [running]:query.log-github.com/couchbase/query/execution.(*Context).Recover(0xc00283ea80, 0xc0008be900)query.log- /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/context.go:633 +0xbcquery.log:panic(0x1ca7620, 0x310e4d0)query.log: /home/couchbase/.cbdepscache/exploded/x86_64/go-1.11.4/go/src/runtime/panic.go:513 +0x1b9query.log-github.com/couchbase/query/execution.(*AggregateInfo).evaluatePreAggregate(0xc000b9d040, 0xc0008be900, 0xc003bcc080, 0x0, 0x0, 0x0)query.log- /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/window.go:339 +0x3a5query.log-github.com/couchbase/query/execution.(*WindowAggregate).processWindowAggregates(0xc0008be900, 0x0, 0x2120740, 0xc002568aa0, 0x0)query.log- /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/window.go:1145 +0x2bequery.log-github.com/couchbase/query/execution.(*WindowAggregate).afterWindowPartition(0xc0008be900, 0x1841f01, 0xc001902200)query.log- /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/window.go:1117 +0x170query.log-github.com/couchbase/query/execution.(*WindowAggregate).afterItems(0xc0008be900, 0xc00283ea80)query.log- /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/window.go:1007 +0x30query.log-github.com/couchbase/query/execution.(*base).runConsumer.func1()query.log- /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/base.go:670 +0x275
      

      Attachments

        Activity

          People

            evgeny.makarenko Evgeny Makarenko (Inactive)
            evgeny.makarenko Evgeny Makarenko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              PagerDuty