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

Indexer crashes when multiscan api is used for multiple seeks and one of the seek is on an unindexed field

    XMLWordPrintable

Details

    • Untriaged
    • Unknown

    Description

      Build : 5.5.0-2929

      Test : python testrunner.py -i 2i.ini -p gsi_type=memory_optimized,reset_services=True -t 2i.multiscan_enhancement_2i.SecondaryIndexingMultiscanTests.test_simple_index_multiple_seek,doc-per-day=100,dataset=array,nodes_init=2,services_init=kv:n1ql-index

      This is a test where we have an index on a single field - name. The test is to run multiple seeks in a single scan. If each seek is on 1 field, it goes fine. But indexer crashes if the seek is done on multiple fields, indexer panics and crashes. It should handle this invalid input gracefully and error out instead of crashing.

      Following scans work fine :

      2018-06-27 14:44:19 | INFO | MainProcess | test_thread | [rest_client.multiscan_for_gsi_index_with_rest] "{\"reverse\": false, \"projection\": \"{\\\"EntryKeys\\\": [0], \\\"PrimaryKey\\\": true}\", \"distinct\": false, \"limit\": 10000, \"offset\": 0, \"stale\": \"false\", \"scans\": \"[{\\\"Seek\\\": [null]}, {\\\"Seek\\\": [\\\"Winta\\\"]}]\"}"
      2018-06-27 14:44:19 | INFO | MainProcess | test_thread | [rest_client.multiscan_for_gsi_index_with_rest] "{\"reverse\": false, \"projection\": \"{\\\"EntryKeys\\\": [0], \\\"PrimaryKey\\\": true}\", \"distinct\": false, \"limit\": 10000, \"offset\": 0, \"stale\": \"false\", \"scans\": \"[{\\\"Seek\\\": [null]}, {\\\"Seek\\\": [\\\"Zack\\\"]}]\"}"
      2018-06-27 14:44:19 | INFO | MainProcess | test_thread | [rest_client.multiscan_for_gsi_index_with_rest] "{\"reverse\": false, \"projection\": \"{\\\"EntryKeys\\\": [0], \\\"PrimaryKey\\\": true}\", \"distinct\": false, \"limit\": 10000, \"offset\": 0, \"stale\": \"false\", \"scans\": \"[{\\\"Seek\\\": [null]}, {\\\"Seek\\\": [null]}]\"}"
      2018-06-27 14:44:19 | INFO | MainProcess | test_thread | [rest_client.multiscan_for_gsi_index_with_rest] "{\"reverse\": false, \"projection\": \"{\\\"EntryKeys\\\": [0], \\\"PrimaryKey\\\": true}\", \"distinct\": false, \"limit\": 10000, \"offset\": 0, \"stale\": \"false\", \"scans\": \"[{\\\"Seek\\\": [\\\"Adara\\\"]}, {\\\"Seek\\\": [\\\"Winta\\\"]}]\"}"
      

      But the following scans does not work :
      [

      {"Seek": ["Kala", 30]}

      ,

      {"Seek": ["Kala", 30]}

      ]
      [

      {"Seek": ["Kala", 30]}

      ,

      {"Seek": ["Winta"]}

      ]
      [

      {"Seek": ["Kala", 30]}

      ,

      {"Seek": ["Zack"]}

      ]
      [

      {"Seek": ["Kala", 30]}

      ,

      {"Seek": [None]}

      ]

      The Panic is :

      panic: runtime error: index out of range
       
      goroutine 299 [running]:
      panic(0xe3c500, 0xc4200160b0)
      	/home/couchbase/.cbdepscache/exploded/x86_64/go-1.7.6/go/src/runtime/panic.go:500 +0x1a1 fp=0xc42651da50 sp=0xc42651d9c0
      runtime.panicindex()
      	/home/couchbase/.cbdepscache/exploded/x86_64/go-1.7.6/go/src/runtime/panic.go:27 +0x6d fp=0xc42651da80 sp=0xc42651da50
      github.com/couchbase/indexing/secondary/indexer.(*ScanRequest).setExplodePositions(0xc423bc3b00)
      	goproj/src/github.com/couchbase/indexing/secondary/indexer/scan_request.go:1125 +0x2c6 fp=0xc42651dc40 sp=0xc42651da80
      github.com/couchbase/indexing/secondary/indexer.NewScanRequest(0xf08680, 0xc423597e40, 0xe6aec0, 0xc423440ba0, 0xc4231e7500, 0xc42001ec80, 0xc42339b298, 0x2, 0xc42651dde0)
      	goproj/src/github.com/couchbase/indexing/secondary/indexer/scan_request.go:428 +0xd54 fp=0xc42651dd70 sp=0xc42651dc40
      github.com/couchbase/indexing/secondary/indexer.(*scanCoordinator).serverCallback(0xc42001ec80, 0xf08680, 0xc423597e40, 0xe6aec0, 0xc423440ba0, 0x183b260, 0xc42331a2e8, 0xc4231e7500)
      	goproj/src/github.com/couchbase/indexing/secondary/indexer/scan_coordinator.go:216 +0xe4 fp=0xc42651dea0 sp=0xc42651dd70
      github.com/couchbase/indexing/secondary/indexer.(*scanCoordinator).(github.com/couchbase/indexing/secondary/indexer.serverCallback)-fm(0xf08680, 0xc423597e40, 0xe6aec0, 0xc423440ba0, 0x183b260, 0xc42331a2e8, 0xc4231e7500)
      	goproj/src/github.com/couchbase/indexing/secondary/indexer/scan_coordinator.go:96 +0x73 fp=0xc42651def0 sp=0xc42651dea0
      github.com/couchbase/indexing/secondary/queryport.(*Server).handleConnection(0xc42001c500, 0x183b260, 0xc42331a2e8)
      	goproj/src/github.com/couchbase/indexing/secondary/queryport/server.go:198 +0x2f7 fp=0xc42651df88 sp=0xc42651def0
      runtime.goexit()
      	/home/couchbase/.cbdepscache/exploded/x86_64/go-1.7.6/go/src/runtime/asm_amd64.s:2086 +0x1 fp=0xc42651df90 sp=0xc42651df88
      created by github.com/couchbase/indexing/secondary/queryport.(*Server).listener
      	goproj/src/github.com/couchbase/indexing/secondary/queryport/server.go:151 +0x38a
      

      Attachments

        Issue Links

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

          Activity

            People

              prathibha Prathibha Bisarahalli (Inactive)
              mihir.kamdar Mihir Kamdar (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty