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

Application hangs when N1QL Parameterized Prepared Statement is executed with adhoc=false

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 6.5.0
    • 4.5.1, 4.6.4, 5.0.1, 5.5.0
    • query
    • Triaged
    • Unknown

    Description

      Issue

      The application hangs when executing a N1QL Parameterized prepared query when adhoc is set to false.

      Reproduction

      This is the prepared statement executed through the Query Workbench:

      prepare ps_test as select * from `travel-sample` where id = $id

      This is the code (snippet)

      JsonObject placeholderValues = JsonObject.create().put("id", 10);
      N1qlQuery hangQueryParameterized = N1qlQuery.parameterized("execute ps_test", 
      placeholderValues,N1qlParams.build().consistency(ScanConsistency.REQUEST_PLUS).adhoc(false));
      N1qlQueryResult queryResultParameterized = bucket.query(hangQueryParameterized);
      for (N1qlQueryRow row : queryResultParameterized) {
       System.out.println(row);
      }

      ... hangs

      Right usage

      Setting adhoc(true) in code snippet is the right usage. Here is the completed_requests:

       

      {
       "completed_requests": {
       "elapsedTime": "7.027909111s",
       "errorCount": 0,
       "node": "10.111.170.101:8091",
       "phaseCounts": {
       "fetch": 31591,
       "primaryScan": 31591
       },
       "phaseOperators": {
       "authorize": 1,
       "fetch": 1,
       "primaryScan": 1
       },
       "preparedName": "ps_test",
       "preparedText": "prepare ps_test as select * from `travel-sample` where id = $id",
       "remoteAddr": "10.111.170.1:58164",
       "requestId": "da5f63fe-5c61-44c6-ae0b-0a9157988a7d",
       "requestTime": "2018-02-14 00:02:29.477282904 +0000 UTC",
       "resultCount": 1,
       "resultSize": 138,
       "scanConsistency": "scan_plus",
       "serviceTime": "7.027839477s",
       "state": "completed",
       "statement": "execute ps_test",
       "userAgent": "couchbase-java-client/2.5.3 (git: 2.5.3, core: 1.5.3) (Mac OS X/10.13.3 x86_64; Java HotSpot(TM) 64-Bit Server VM 1.8.0_144-b01)",
       "users": "test"
       }
       },
      

       

       

      Attachments

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

        Activity

          People

            korrigan.clark Korrigan Clark (Inactive)
            krishna.doddi Krishna Doddi
            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