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
    • Resolution: Fixed
    • Blocker
    • 3.2.3
    • 3.2.2
    • 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

          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