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

cbq query timeout doesn't time out on primary index creation

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 6.0.0
    • 6.5.0
    • query
    • Untriaged
    • Unknown

    Description

      Tried this with a much longer timeout as well, but easy to reproduce with a short one:

      [root@ip-10-0-112-85 data]# /opt/couchbase/bin/cbq -u Administrator -t "1s"
      Enter Password: 
      Connected to : http://localhost:8091/. Type Ctrl-D or \QUIT to exit.
       
      Path to history file for the shell : /root/.cbq_history 
      cbq> create primary index on default;
      
      

      Query monitor shows that the query is in "timeout" state but cbq has not returned. 

       

      Also, CTRL-c kicks you out of the whole cbq process which is a little annoying when all you wanted to do was cancel the running query...is there anyway to catch CTRL-c and cancel the query instead of breaking out of the process?  Or is there a different key combo that will achieve that?

      Attachments

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

        Activity

          perry Perry Krug added a comment -

          Not sure if it's related or a separate path, but cancelling the active query after it has timed out also does not return control to CBQ.

          perry Perry Krug added a comment - Not sure if it's related or a separate path, but cancelling the active query after it has timed out also does not return control to CBQ.

          The CTRL C issue is tracked in MB-17881 - This is a liner issue. Will need to think of how to work around this at some point. 

          isha Isha Kandaswamy (Inactive) added a comment - The CTRL C issue is tracked in MB-17881 - This is a liner issue. Will need to think of how to work around this at some point. 

          I will update the cbq manifest. But now if there is a timeout, control is returned to cbq.

          cbq> SELECT a.id from SEARCH_QUERY("its_idx",{"query": {"query": "francisco"}}).hits a order by a.id;
          {
              "requestID": "ae1a0da9-373b-4ef6-90de-1ffa4a7fc10a",
              "signature": {
                  "id": "json"
              },
              "results": [
              ],
              "errors": [
                  {
                      "code": 1080,
                      "msg": "Timeout 1s exceeded",
                      "retry": true
                  }
              ],
              "status": "timeout",
              "metrics": {
                  "elapsedTime": "1.009223147s",
                  "executionTime": "1.009154196s",
                  "resultCount": 0,
                  "resultSize": 0,
                  "errorCount": 1
              }
          }
          

          With CTRL+C kicking you out of the process - So as of now, ctrl+c also stops the query and then exits the process. This is in keeping with command line tool behaviors in general. The liner package which is the 3rd party package that we use for cbq, doesnt plan to add a provision to pass control back to the liner. It prefers to abort with Ctrl+c. I suggest documenting this and then closing the issue.

          isha Isha Kandaswamy (Inactive) added a comment - I will update the cbq manifest. But now if there is a timeout, control is returned to cbq. cbq> SELECT a.id from SEARCH_QUERY( "its_idx" ,{ "query" : { "query" : "francisco" }}).hits a order by a.id; { "requestID" : "ae1a0da9-373b-4ef6-90de-1ffa4a7fc10a" , "signature" : { "id" : "json" }, "results" : [ ], "errors" : [ { "code" : 1080 , "msg" : "Timeout 1s exceeded" , "retry" : true } ], "status" : "timeout" , "metrics" : { "elapsedTime" : "1.009223147s" , "executionTime" : "1.009154196s" , "resultCount" : 0 , "resultSize" : 0 , "errorCount" : 1 } } With CTRL+C kicking you out of the process - So as of now, ctrl+c also stops the query and then exits the process. This is in keeping with command line tool behaviors in general. The liner package which is the 3rd party package that we use for cbq, doesnt plan to add a provision to pass control back to the liner. It prefers to abort with Ctrl+c. I suggest documenting this and then closing the issue.

          Verified for 6.5.0-4558:

          [root@localhost bin]# ./cbq -u=Administrator -t="1s"
           Enter Password:
           Connected to : http://localhost:8091/. Type Ctrl-D or \QUIT to exit. Path to history file for the shell : /root/.cbq_history
          cbq> create primary index on `beer-sample`;
          {
              "requestID": "59b5ca91-5cc3-44d4-bcd0-b87d632ba93d",
              "signature": null,
              "results": [
              ],
              "errors": [
                  {
                      "code": 1080,
                      "msg": "Timeout 1s exceeded",
                      "retry": true
                  }
              ],
              "status": "timeout",
              "metrics": {
                  "elapsedTime": "1.000546014s",
                  "executionTime": "1.000489209s",
                  "resultCount": 0,
                  "resultSize": 0,
                  "errorCount": 1
              }
          }
          

          evgeny.makarenko Evgeny Makarenko (Inactive) added a comment - Verified for 6.5.0-4558: [root @localhost bin]# ./cbq -u=Administrator -t= "1s" Enter Password: Connected to : http: //localhost:8091/. Type Ctrl-D or \QUIT to exit. Path to history file for the shell : /root/.cbq_history cbq> create primary index on `beer-sample`; { "requestID" : "59b5ca91-5cc3-44d4-bcd0-b87d632ba93d" , "signature" : null , "results" : [ ], "errors" : [ { "code" : 1080 , "msg" : "Timeout 1s exceeded" , "retry" : true } ], "status" : "timeout" , "metrics" : { "elapsedTime" : "1.000546014s" , "executionTime" : "1.000489209s" , "resultCount" : 0 , "resultSize" : 0 , "errorCount" : 1 } }

          People

            ajay.bhullar Ajay Bhullar
            perry Perry Krug
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              PagerDuty