Uploaded image for project: 'Couchbase C client library libcouchbase'
  1. Couchbase C client library libcouchbase
  2. CCBC-1510

On behalf is not working with get request

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 3.2.2
    • 3.2.3
    • None
    • None
    • 1

    Description

      when doing get operation with on_behalf returns LCB_ERR_TIMEOUT.
      lcb store works without any error.
      Without on_behalf_of header it returns correct results without any error.

      code snippet:

       lcb_CMDGET *cmd;
        lcb_cmdget_create(&cmd);
        std::cout << "DBG: GET CREATE" << std::endl;
        lcb_cmdget_collection(cmd, scope_name_.c_str(), scope_name_.size(),
                              collection_name_.c_str(), collection_name_.size());
        lcb_cmdget_key(cmd, key.c_str(), key.length());
        lcb_cmdget_timeout(cmd, 500000000);
        std::string user = "Administrator";
        lcb_cmdget_on_behalf_of(cmd, user.c_str(), user.size());
        auto err = lcb_get(connection_, nullptr, cmd);
         std::cout << "Sending result: " << err << std::endl;
        err = lcb_wait(connection_, LCB_WAIT_DEFAULT);
         std::cout << "Wait result: " << err << std::endl;
      

      Logging with on_behalf of

      DBG: GET CREATE
      SBG: <localhost:11210> (HE=0x7ff518e066d0) Found ready connection in pool. Reusing socket and not creating new connection
      Sending result: 0
      SBG: <localhost:11210> (HE=0x7ff518e066d0) Assigning R=0x7ff518d1dff0 SOCKET=0x7ff518e06b80
      SBG: <localhost:11210> (SRV=0x7ff518d1d110) Got new KV connection (json=yes, snappy=yes, mt=yes, durability=no, bucket=yes "src")
      SBG: <localhost:11210> (CTX=0x7ff518d1e150,unknown) Pairing with SOCK=0de65e96a677a903
      SBG: Background-polling for new configuration
      SBG: Refreshing current cluster map (bucket: src)
      SBG: Attempting to retrieve cluster map via CCCP
      SBG: Re-Issuing CCCP Command on server struct 0x7ff518d1d110 (localhost:11210)
      SBG: <NOHOST:NOPORT> (CTX=0x0,) Could not get configuration: LCB_ERR_TIMEOUT (201)
      SBG: Provider 'CCCP' failed: LCB_ERR_TIMEOUT (201)
      SBG: Maximum provider reached. Resetting index
      SBG: Background-polling for new configuration
      SBG: Refreshing current cluster map (bucket: src)
      SBG: Attempting to retrieve cluster map via CCCP
      SBG: Re-Issuing CCCP Command on server struct 0x7ff518d1d110 (localhost:11210)
      SBG: Failing command with error LCB_ERR_TIMEOUT (201): {"b":"src","i":"6aa5a66a945e924a/0de65e96a677a903/1","l":"127.0.0.1:54362","r":"localhost:11210","s":"kv:get_cluster_config","t":2500000}
      SBG: <localhost:11210> (CTX=0x7ff518d1e150,memcached,SRV=0x7ff518d1d110,IX=0) Server timed out. Some commands have failed
      SBG: <localhost:11210> (CTX=0x7ff518d1e150,memcached,SRV=0x7ff518d1d110,IX=0) Scheduling next timeout for 2499 ms. This is not an error
      SBG: <NOHOST:NOPORT> (CTX=0x0,) Could not get configuration: LCB_ERR_TIMEOUT (201)
      SBG: Provider 'CCCP' failed: LCB_ERR_TIMEOUT (201)
      SBG: Maximum provider reached. Resetting index
      SBG: Background-polling for new configuration
      SBG: Refreshing current cluster map (bucket: src)
      

      Without on_behalf_of

      DBG: GET CREATE
      SBG: <localhost:11210> (HE=0x7f953fe042f0) Found ready connection in pool. Reusing socket and not creating new connection
      Sending result: 0
      SBG: <localhost:11210> (HE=0x7f953fe042f0) Assigning R=0x7f953fe06490 SOCKET=0x7f953fe04b60
      SBG: <localhost:11210> (SRV=0x7f953fe05540) Got new KV connection (json=yes, snappy=yes, mt=yes, durability=no, bucket=yes "src")
      SBG: <localhost:11210> (CTX=0x7f953ff043f0,unknown) Pairing with SOCK=c8123446c183c3d6
      Wait result: 0
      

      Same operation works with go sdk

      Attachments

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

        Activity

          Ankit Prabhu, Jeelan Poola, please verify this patch http://review.couchbase.org/c/libcouchbase/+/163540 and leave your review on gerrit. Then I will be able to merge it and will give you SHA-1 for the server

          avsej Sergey Avseyev added a comment - Ankit Prabhu , Jeelan Poola , please verify this patch http://review.couchbase.org/c/libcouchbase/+/163540 and leave your review on gerrit. Then I will be able to merge it and will give you SHA-1 for the server

          Ankit Prabhu, Jeelan Poola, here is SHA-1 of merged change: 494582fa897e1e1ca9339c0695e70b2e4d8ab96a

          Thank you for report

          avsej Sergey Avseyev added a comment - Ankit Prabhu , Jeelan Poola , here is SHA-1 of merged change: 494582fa897e1e1ca9339c0695e70b2e4d8ab96a Thank you for report

          Build couchbase-server-7.1.0-1491 contains libcouchbase commit 494582f with commit message:
          CCBC-1510: fix key length calculation for exists/get/touch/unlock

          build-team Couchbase Build Team added a comment - Build couchbase-server-7.1.0-1491 contains libcouchbase commit 494582f with commit message: CCBC-1510 : fix key length calculation for exists/get/touch/unlock

          People

            avsej Sergey Avseyev
            ankit.prabhu Ankit Prabhu
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty