Details
-
Bug
-
Resolution: User Error
-
Minor
-
None
-
2.3.4
-
None
-
LCB 2.8.5
Description
Feel free to assign to Libcouchbase if it's deemed a libcouchbase bug, opened as a PYCBC as I have a simple script demonstrating the issue with Python.
Essentially the issue is that an application which runs queries will never be able to work correctly if there is not at least one query node in the cluster at the time of bootstrap.
Reproduction
Test Script
from couchbase.n1ql import N1QLQuery
|
import time
|
from couchbase.bucket import Bucket
|
bkt = Bucket('couchbase://10.142.171.102/test', password='password')
|
q = N1QLQuery('SELECT 1+1')
|
while True:
|
try:
|
for row in bkt.n1ql_query(q):
|
print row
|
except Exception as e:
|
print e
|
time.sleep(1)
|
- Create a single node cluster with just data
- Add a bucket (and user with access to the bucket)
- Start the script, observe the errors
- Add a new node in with the query service
- Observe that the errors do not go away, the application still believes that it is unable to run the query despite the fact there's now a query node
- Restarting the application fixes the issue as the SDK is now able to use the new query node
I know that this seems a bit contrived, but this exact issue was hit when creating https://github.com/couchbaselabs/connect-eu-demo, we wanted to demonstrate new capabilities being enabled as new services came into the cluster. In order to workaround the issue we had to start with 1 query node in the cluster, which seems a bit strange and messy.