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

UDF/TXN panic with update statement

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 7.1.0
    • 7.1.0
    • query
    • None
    • 7.1.0-2071
    • Untriaged
    • 1
    • Yes

    Description

      To repro:

      • setup 2 node cluster
      • create default bucket
      • import json data
      • create index:
        • create primary index on default
        • CREATE INDEX adv_job_title IF NOT EXISTS ON `default`(`job_title`)
      • create udf:
        •  curl -s -k -X POST http://172.23.108.57:8093/evaluator/v1/libraries/n1ql -u Administrator:password -H 'content-type: application/json' -d 'function transaction_dml() { var query1 = BEGIN WORK; var query2 = UPDATE default SET job_title = "ENGINEER" WHERE join_yr = 2011 AND join_mo = 10 AND lower(job_title) = "engineer" RETURNING name, job_title; var query3 = ROLLBACK; return "Success"; }'
        • CREATE OR REPLACE FUNCTION transaction_dml() LANGUAGE JAVASCRIPT AS "transaction_dml" AT "n1ql"
      • Execute function: EXECUTE FUNCTION transaction_dml() 

       

      In query.log see panic:

      2022-01-18T11:39:37.566-08:00 [SEVERE] panic: interface conversion: interface {} is nil, not *couchbase.TransactionMutations
      2022-01-18T11:39:37.566-08:00 [SEVERE] request text: <ud>UPDATE default SET job_title = "ENGINEER" WHERE join_yr = 2011 AND join_mo = 10 AND lower(job_title) = "engineer" RETURNING name, job_title;</ud>
      2022-01-18T11:39:37.566-08:00 [SEVERE] query context: <ud></ud>
      2022-01-18T11:39:37.566-08:00 [SEVERE] stack: goroutine 916 [running]:
      github.com/couchbase/query/execution.(*Context).Recover(0xc004286a00, 0xc00088b8c0)
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/context.go:1040 +0xc6
      panic(0x23096a0, 0xc0005fc030)
              /home/couchbase/.cbdepscache/exploded/x86_64/go-1.16.6/go/src/runtime/panic.go:965 +0x1b9
      github.com/couchbase/query/execution.(*base).runConsumer.func1.2(0x1, 0xc00088b8c0, 0xc004286a00)
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/base.go:888 +0xdc
      panic(0x23096a0, 0xc0005fc030)
              /home/couchbase/.cbdepscache/exploded/x86_64/go-1.16.6/go/src/runtime/panic.go:965 +0x1b9
      github.com/couchbase/query/datastore/couchbase.(*keyspace).txPerformOp(0xc000372000, 0x3, 0xc000b97920, 0x21, 0xc0008621a8, 0x8, 0xc0008621a0, 0x8, 0x0, 0x0, ...)
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/datastore/couchbase/txcouchbase.go:513 +0x1832
      github.com/couchbase/query/datastore/couchbase.(*keyspace).performOp(0xc000372000, 0x3, 0xc000b97920, 0x21, 0xc0008621a8, 0x8, 0xc0008621a0, 0x8, 0xc000d72000, 0x1, ...)
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/datastore/couchbase/couchbase.go:1907 +0x172
      github.com/couchbase/query/datastore/couchbase.(*collection).Update(0xc000891d40, 0xc000d72000, 0x1, 0x200, 0x288dc00, 0xc004286a00, 0x0, 0x1, 0x1, 0x0, ...)
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/datastore/couchbase/collections.go:328 +0x196
      github.com/couchbase/query/execution.(*SendUpdate).flushBatch(0xc00088b8c0, 0xc004286a00, 0x0)
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/update_send.go:188 +0x682
      ... 

       

      Attachments

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

        Activity

          People

            marco.greco Marco Greco (Inactive)
            pierre.regazzoni Pierre Regazzoni
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty