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

Libcouchbase returns timeout error when collection doesn't exist

    XMLWordPrintable

Details

    • Bug
    • Status: Reopened
    • Critical
    • Resolution: Unresolved
    • 3.2.5
    • None
    • library
    • None
    • 1

    Description

      All the bucket ops fails with LCB_TIMEOUT when collection specified not found.

      2022-05-25T14:47:55.453+05:30 [Info] eventing-consumer [worker_test_0:/var/folders/hv/kx_3xt_16bv27mp88bvx4hy80000gn/T//127.0.0.1:9000_0_1452035700.sock:51528] [lcb,retryq L:164 I:651589169] Failing command (pkt=0x7fc619c26440, opaque=3, retries=31, now=86422156ms, spent=5000892us, status=0x88) requested error: LCB_ERR_TIMEOUT (201), from retry queue: LCB_ERR_TIMEOUT (201)
      2022-05-25T14:48:00.661+05:30 [Info] eventing-consumer [worker_test_0:/var/folders/hv/kx_3xt_16bv27mp88bvx4hy80000gn/T//127.0.0.1:9000_0_1452035700.sock:51528] [lcb,retryq L:164 I:651589169] Failing command (pkt=0x7fc61b40e940, opaque=6, retries=31, now=86427363ms, spent=5002707us, status=0x88) requested error: LCB_ERR_TIMEOUT (201), from retry queue: LCB_ERR_TIMEOUT (201)
      

      Attachments

        Issue Links

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

          Activity

            ankit.prabhu Ankit Prabhu added a comment -

            For collection/scope doesn't exist returning LCB_ERR_TIMEOUT will break the LCB_ERROR_IS_TRANSIENT since it will return true even if the code returned by kv is not retriable and application will end up retrying the request.
            In eventing for now we fixed this by checking kv status code(lcb_errctx_kv_status_code) but we expect lcb to give more detailed error code when scope/collection doesn't exist.
            Sergey Avseyev, Could you please take a look?

            ankit.prabhu Ankit Prabhu added a comment - For collection/scope doesn't exist returning LCB_ERR_TIMEOUT will break the LCB_ERROR_IS_TRANSIENT since it will return true even if the code returned by kv is not retriable and application will end up retrying the request. In eventing for now we fixed this by checking kv status code(lcb_errctx_kv_status_code) but we expect lcb to give more detailed error code when scope/collection doesn't exist. Sergey Avseyev , Could you please take a look?

            I think we've covered this previously Ankit Prabhu .  As bucket/collection creation proceeds asynchronously through the cluster, there is no way to really know if it should exist and doesn't exist yet or does not exist.

            Because of that limitation, SDKs retry until timeout in order to address the UX behind the scenario where they use the management API to create a bucket or collection, then immediately try to access it.  That was an intentional design decision.  There were only two options given the interface from the cluster, one being retry until timeout, the other being fail to allow the bucket or collection to be accessed.

            There is a plan to make this better in a future release.  See MB-46643 which is about collections and MB-111484.  

            libcouchbase does have retry strategies which were discussed with the eventing team before.  If you want to handle these at a higher level, you can.  libcouchbase is working as intended here.

            ingenthr Matt Ingenthron added a comment - I think we've covered this previously Ankit Prabhu .  As bucket/collection creation proceeds asynchronously through the cluster, there is no way to really know if it should exist and doesn't exist yet or does not exist. Because of that limitation, SDKs retry until timeout in order to address the UX behind the scenario where they use the management API to create a bucket or collection, then immediately try to access it.  That was an intentional design decision.  There were only two options given the interface from the cluster, one being retry until timeout, the other being fail to allow the bucket or collection to be accessed. There is a plan to make this better in a future release.  See MB-46643 which is about collections and MB-111484.   libcouchbase does have retry strategies which were discussed with the eventing team before.  If you want to handle these at a higher level, you can.  libcouchbase is working as intended here.
            ankit.prabhu Ankit Prabhu added a comment -

            Matt Ingenthron, Looks like lcb doesn't retry till timeout for scope/collection not exist and request is made once to kv and pass that error message back to application as TIMEOUT.

            The expectation here is that lcb gives proper error code(SCOPE_NOT_FOUND or COLLECTION_NOT_FOUND) instead of TIMEOUT.

            These error can give LCB_ERROR_IS_TRANSIENT() true in which case application can take decision to retry or not.

            ankit.prabhu Ankit Prabhu added a comment - Matt Ingenthron , Looks like lcb doesn't retry till timeout for scope/collection not exist and request is made once to kv and pass that error message back to application as TIMEOUT. The expectation here is that lcb gives proper error code(SCOPE_NOT_FOUND or COLLECTION_NOT_FOUND) instead of TIMEOUT. These error can give LCB_ERROR_IS_TRANSIENT() true in which case application can take decision to retry or not.
            ray.cardillo Ray Cardillo added a comment -

            Jeelan Poola I've asked Sergey Avseyev to look at this but he's dealing with some urgent relocation related activities right now. He should be able to respond early next week.

            ray.cardillo Ray Cardillo added a comment - Jeelan Poola I've asked Sergey Avseyev to look at this but he's dealing with some urgent relocation related activities right now. He should be able to respond early next week.

            People

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

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty