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

Subdoc Fetch can cause panic (xattrs)

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 6.5.0, 6.0.0, 5.5.2
    • 6.5.0, 5.5.3, 6.0.1
    • query
    • None
    • Untriaged
    • Unknown

    Description

      KV Fetch of XATTRS that contains non existent key (or deleted between indexscan and fetch).
      Repro: USE KEYS (need more than 1 key trigger issue, for one key it goes in different code path)

      SELECT META().xattrs._sync
      FROM default USE KEYS ["xxxx", "yy"];
      

      request text:
      <ud>select META().xattrs._sync from default use keys ["xxxx", "yy"];</ud>
       
      stack:
      goroutine 245 [running]:
      github.com/couchbase/query/execution.(*Context).Recover(0xc420733c80)
      	/Users/sitaram/master/olap/src/github.com/couchbase/query/execution/context.go:519 +0xbc
      panic(0x4ad5a40, 0x5444380)
      	/usr/local/Cellar/go/1.8.3/libexec/src/runtime/panic.go:489 +0x2cf
      github.com/couchbase/query/datastore/couchbase.getSubDocFetchResults(0xc420d3e7e9, 0x2, 0xc420c13560, 0xc420cdd840, 0x2, 0x2, 0x1, 0xc420cdd840, 0x2)
      	/Users/sitaram/master/olap/src/github.com/couchbase/query/datastore/couchbase/couchbase.go:1123 +0xc03
      github.com/couchbase/query/datastore/couchbase.(*keyspace).Fetch(0xc4204d4460, 0xc420d63c00, 0x2, 0x40, 0xc420d0ea20, 0x53cb140, 0xc420733c80, 0xc420d3e990, 0x1, 0x2, ...)
      	/Users/sitaram/master/olap/src/github.com/couchbase/query/datastore/couchbase/couchbase.go:1072 +0x42e
      github.com/couchbase/query/execution.(*Fetch).flushBatch(0xc420d306c0, 0xc420733c80, 0x10000000474d900)
      	/Users/sitaram/master/olap/src/github.com/couchbase/query/execution/fetch.go:140 +0x290
      github.com/couchbase/query/execution.(*Fetch).afterItems(0xc420d306c0, 0xc420733c80)
      	/Users/sitaram/master/olap/src/github.com/couchbase/query/execution/fetch.go:82 +0x35
      github.com/couchbase/query/execution.(*base).runConsumer.func1()
      	/Users/sitaram/master/olap/src/github.com/couchbase/query/execution/base.go:564 +0x296
      github.com/couchbase/query/util.(*Once).Do(0xc420d307c8, 0xc420add738)
      	/Users/sitaram/master/olap/src/github.com/couchbase/query/util/sync.go:53 +0x68
      github.com/couchbase/query/execution.(*base).runConsumer(0xc420d306c0, 0x53c8760, 0xc420d306c0, 0xc420733c80, 0x0, 0x0)
      	/Users/sitaram/master/olap/src/github.com/couchbase/query/execution/base.go:565 +0xaf
      github.com/couchbase/query/execution.(*Fetch).RunOnce(0xc420d306c0, 0xc420733c80, 0x0, 0x0)
      	/Users/sitaram/master/olap/src/github.com/couchbase/query/execution/fetch.go:66 +0x5c
      created by github.com/couchbase/query/execution.(*base).runConsumer.func1
      	/Users/sitaram/master/olap/src/github.com/couchbase/query/execution/base.go:550 +0x2f6
      

      Attachments

        For Gerrit Dashboard: MB-32120
        # Subject Branch Project Status CR V

        Activity

          Sitaram.Vemulapalli Sitaram Vemulapalli created issue -
          Sitaram.Vemulapalli Sitaram Vemulapalli made changes -
          Field Original Value New Value
          Link This issue is triggering CBSE-6021 [ CBSE-6021 ]
          Sitaram.Vemulapalli Sitaram Vemulapalli made changes -
          Link This issue is triggering CBSE-6021 [ CBSE-6021 ]
          Sitaram.Vemulapalli Sitaram Vemulapalli made changes -
          Link This issue causes CBSE-6021 [ CBSE-6021 ]
          Sitaram.Vemulapalli Sitaram Vemulapalli made changes -
          Description KV Fetch of XATTRS that contains non existent key (or deleted before fetch).
          Repro: USE KEYS (need more than 1 key tigger issue)

          {code:java}
          SELECT META().xattrs._sync
          FROM default USE KEYS ["xxxx", "yy"];
          {code}



          {code:java}
          request text:
          <ud>select META().xattrs._sync from default use keys ["xxxx", "yy"];</ud>

          stack:
          goroutine 245 [running]:
          github.com/couchbase/query/execution.(*Context).Recover(0xc420733c80)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/context.go:519 +0xbc
          panic(0x4ad5a40, 0x5444380)
          /usr/local/Cellar/go/1.8.3/libexec/src/runtime/panic.go:489 +0x2cf
          github.com/couchbase/query/datastore/couchbase.getSubDocFetchResults(0xc420d3e7e9, 0x2, 0xc420c13560, 0xc420cdd840, 0x2, 0x2, 0x1, 0xc420cdd840, 0x2)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/datastore/couchbase/couchbase.go:1123 +0xc03
          github.com/couchbase/query/datastore/couchbase.(*keyspace).Fetch(0xc4204d4460, 0xc420d63c00, 0x2, 0x40, 0xc420d0ea20, 0x53cb140, 0xc420733c80, 0xc420d3e990, 0x1, 0x2, ...)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/datastore/couchbase/couchbase.go:1072 +0x42e
          github.com/couchbase/query/execution.(*Fetch).flushBatch(0xc420d306c0, 0xc420733c80, 0x10000000474d900)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/fetch.go:140 +0x290
          github.com/couchbase/query/execution.(*Fetch).afterItems(0xc420d306c0, 0xc420733c80)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/fetch.go:82 +0x35
          github.com/couchbase/query/execution.(*base).runConsumer.func1()
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/base.go:564 +0x296
          github.com/couchbase/query/util.(*Once).Do(0xc420d307c8, 0xc420add738)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/util/sync.go:53 +0x68
          github.com/couchbase/query/execution.(*base).runConsumer(0xc420d306c0, 0x53c8760, 0xc420d306c0, 0xc420733c80, 0x0, 0x0)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/base.go:565 +0xaf
          github.com/couchbase/query/execution.(*Fetch).RunOnce(0xc420d306c0, 0xc420733c80, 0x0, 0x0)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/fetch.go:66 +0x5c
          created by github.com/couchbase/query/execution.(*base).runConsumer.func1
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/base.go:550 +0x2f6
          {code}

          KV Fetch of XATTRS that contains non existent key (or deleted between indexscan and fetch).
          Repro: USE KEYS (need more than 1 key tigger issue)

          {code:java}
          SELECT META().xattrs._sync
          FROM default USE KEYS ["xxxx", "yy"];
          {code}



          {code:java}
          request text:
          <ud>select META().xattrs._sync from default use keys ["xxxx", "yy"];</ud>

          stack:
          goroutine 245 [running]:
          github.com/couchbase/query/execution.(*Context).Recover(0xc420733c80)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/context.go:519 +0xbc
          panic(0x4ad5a40, 0x5444380)
          /usr/local/Cellar/go/1.8.3/libexec/src/runtime/panic.go:489 +0x2cf
          github.com/couchbase/query/datastore/couchbase.getSubDocFetchResults(0xc420d3e7e9, 0x2, 0xc420c13560, 0xc420cdd840, 0x2, 0x2, 0x1, 0xc420cdd840, 0x2)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/datastore/couchbase/couchbase.go:1123 +0xc03
          github.com/couchbase/query/datastore/couchbase.(*keyspace).Fetch(0xc4204d4460, 0xc420d63c00, 0x2, 0x40, 0xc420d0ea20, 0x53cb140, 0xc420733c80, 0xc420d3e990, 0x1, 0x2, ...)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/datastore/couchbase/couchbase.go:1072 +0x42e
          github.com/couchbase/query/execution.(*Fetch).flushBatch(0xc420d306c0, 0xc420733c80, 0x10000000474d900)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/fetch.go:140 +0x290
          github.com/couchbase/query/execution.(*Fetch).afterItems(0xc420d306c0, 0xc420733c80)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/fetch.go:82 +0x35
          github.com/couchbase/query/execution.(*base).runConsumer.func1()
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/base.go:564 +0x296
          github.com/couchbase/query/util.(*Once).Do(0xc420d307c8, 0xc420add738)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/util/sync.go:53 +0x68
          github.com/couchbase/query/execution.(*base).runConsumer(0xc420d306c0, 0x53c8760, 0xc420d306c0, 0xc420733c80, 0x0, 0x0)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/base.go:565 +0xaf
          github.com/couchbase/query/execution.(*Fetch).RunOnce(0xc420d306c0, 0xc420733c80, 0x0, 0x0)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/fetch.go:66 +0x5c
          created by github.com/couchbase/query/execution.(*base).runConsumer.func1
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/base.go:550 +0x2f6
          {code}

          Sitaram.Vemulapalli Sitaram Vemulapalli made changes -
          Description KV Fetch of XATTRS that contains non existent key (or deleted between indexscan and fetch).
          Repro: USE KEYS (need more than 1 key tigger issue)

          {code:java}
          SELECT META().xattrs._sync
          FROM default USE KEYS ["xxxx", "yy"];
          {code}



          {code:java}
          request text:
          <ud>select META().xattrs._sync from default use keys ["xxxx", "yy"];</ud>

          stack:
          goroutine 245 [running]:
          github.com/couchbase/query/execution.(*Context).Recover(0xc420733c80)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/context.go:519 +0xbc
          panic(0x4ad5a40, 0x5444380)
          /usr/local/Cellar/go/1.8.3/libexec/src/runtime/panic.go:489 +0x2cf
          github.com/couchbase/query/datastore/couchbase.getSubDocFetchResults(0xc420d3e7e9, 0x2, 0xc420c13560, 0xc420cdd840, 0x2, 0x2, 0x1, 0xc420cdd840, 0x2)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/datastore/couchbase/couchbase.go:1123 +0xc03
          github.com/couchbase/query/datastore/couchbase.(*keyspace).Fetch(0xc4204d4460, 0xc420d63c00, 0x2, 0x40, 0xc420d0ea20, 0x53cb140, 0xc420733c80, 0xc420d3e990, 0x1, 0x2, ...)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/datastore/couchbase/couchbase.go:1072 +0x42e
          github.com/couchbase/query/execution.(*Fetch).flushBatch(0xc420d306c0, 0xc420733c80, 0x10000000474d900)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/fetch.go:140 +0x290
          github.com/couchbase/query/execution.(*Fetch).afterItems(0xc420d306c0, 0xc420733c80)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/fetch.go:82 +0x35
          github.com/couchbase/query/execution.(*base).runConsumer.func1()
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/base.go:564 +0x296
          github.com/couchbase/query/util.(*Once).Do(0xc420d307c8, 0xc420add738)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/util/sync.go:53 +0x68
          github.com/couchbase/query/execution.(*base).runConsumer(0xc420d306c0, 0x53c8760, 0xc420d306c0, 0xc420733c80, 0x0, 0x0)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/base.go:565 +0xaf
          github.com/couchbase/query/execution.(*Fetch).RunOnce(0xc420d306c0, 0xc420733c80, 0x0, 0x0)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/fetch.go:66 +0x5c
          created by github.com/couchbase/query/execution.(*base).runConsumer.func1
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/base.go:550 +0x2f6
          {code}

          KV Fetch of XATTRS that contains non existent key (or deleted between indexscan and fetch).
          Repro: USE KEYS (need more than 1 key trigger issue, for one key it goes in different code path)

          {code:java}
          SELECT META().xattrs._sync
          FROM default USE KEYS ["xxxx", "yy"];
          {code}



          {code:java}
          request text:
          <ud>select META().xattrs._sync from default use keys ["xxxx", "yy"];</ud>

          stack:
          goroutine 245 [running]:
          github.com/couchbase/query/execution.(*Context).Recover(0xc420733c80)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/context.go:519 +0xbc
          panic(0x4ad5a40, 0x5444380)
          /usr/local/Cellar/go/1.8.3/libexec/src/runtime/panic.go:489 +0x2cf
          github.com/couchbase/query/datastore/couchbase.getSubDocFetchResults(0xc420d3e7e9, 0x2, 0xc420c13560, 0xc420cdd840, 0x2, 0x2, 0x1, 0xc420cdd840, 0x2)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/datastore/couchbase/couchbase.go:1123 +0xc03
          github.com/couchbase/query/datastore/couchbase.(*keyspace).Fetch(0xc4204d4460, 0xc420d63c00, 0x2, 0x40, 0xc420d0ea20, 0x53cb140, 0xc420733c80, 0xc420d3e990, 0x1, 0x2, ...)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/datastore/couchbase/couchbase.go:1072 +0x42e
          github.com/couchbase/query/execution.(*Fetch).flushBatch(0xc420d306c0, 0xc420733c80, 0x10000000474d900)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/fetch.go:140 +0x290
          github.com/couchbase/query/execution.(*Fetch).afterItems(0xc420d306c0, 0xc420733c80)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/fetch.go:82 +0x35
          github.com/couchbase/query/execution.(*base).runConsumer.func1()
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/base.go:564 +0x296
          github.com/couchbase/query/util.(*Once).Do(0xc420d307c8, 0xc420add738)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/util/sync.go:53 +0x68
          github.com/couchbase/query/execution.(*base).runConsumer(0xc420d306c0, 0x53c8760, 0xc420d306c0, 0xc420733c80, 0x0, 0x0)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/base.go:565 +0xaf
          github.com/couchbase/query/execution.(*Fetch).RunOnce(0xc420d306c0, 0xc420733c80, 0x0, 0x0)
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/fetch.go:66 +0x5c
          created by github.com/couchbase/query/execution.(*base).runConsumer.func1
          /Users/sitaram/master/olap/src/github.com/couchbase/query/execution/base.go:550 +0x2f6
          {code}

          wayne Wayne Siu made changes -
          Link This issue blocks MB-31456 [ MB-31456 ]
          wayne Wayne Siu made changes -
          Link This issue blocks MB-31466 [ MB-31466 ]
          Sitaram.Vemulapalli Sitaram Vemulapalli made changes -
          Assignee Keshav Murthy [ keshav ] Mihir Kamdar [ mihir.kamdar ]
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]
          Sitaram.Vemulapalli Sitaram.Vemulapalli made changes -
          Actual End 2018-11-26 16:09 (issue has been closed)
          Sitaram.Vemulapalli Sitaram Vemulapalli made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Sitaram.Vemulapalli Sitaram Vemulapalli made changes -
          Resolution Fixed [ 1 ]
          Status Reopened [ 4 ] Resolved [ 5 ]
          Sitaram.Vemulapalli Sitaram.Vemulapalli made changes -
          Actual End 2018-11-26 16:09 2018-11-26 16:09 (issue has been resolved)
          korrigan.clark Korrigan Clark (Inactive) made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Sitaram.Vemulapalli Sitaram Vemulapalli made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Sitaram.Vemulapalli Sitaram Vemulapalli made changes -
          Resolution Fixed [ 1 ]
          Status Reopened [ 4 ] Closed [ 6 ]
          Sitaram.Vemulapalli Sitaram Vemulapalli made changes -
          Link This issue is triggering CBSE-6268 [ CBSE-6268 ]

          People

            mihir.kamdar Mihir Kamdar (Inactive)
            Sitaram.Vemulapalli Sitaram Vemulapalli
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty