libcouchbase - problem with newly created memcached bucket
The manual section on "Creating and Editing Data Buckets", states the following:
To ensure a bucket is available the recommended approach is try to read a key from the bucket. If you receive a 'key not found' error, or the document for the key, the bucket exists and is available to all nodes in a cluster. You can do this via a Couchbase SDK with any node in the cluster.
I have implemented that and it works fine for couchbase buckets.
However, if I create a bucket with the argument "bucketType=memcached" and then immediately try to read a key from the bucket using lcb_get followed by a call to lcb_wait, the lcb_wait call never returns.
I have temporarily worked around the problem by waiting 10 seconds between creating the memcached bucket and my first attempt to read a key from the bucket, but I'd like to have a more deterministic method of ensuring that the read will not hang.