Details
-
Improvement
-
Resolution: Unresolved
-
Major
-
Cheshire-Cat
Description
CollectionManager collectionManager = bucket.collections();
|
try { |
CollectionSpec spec = CollectionSpec.create(CollectionNames.PROFILE, bucket.defaultScope().name());
|
collectionManager.createCollection(spec);
|
//Thread.sleep(10000); |
} catch (CollectionExistsException e){ |
System.out.println(String.format("Collection <%s> already exists", CollectionNames.PROFILE)); |
} catch (Exception e) { |
System.out.println(String.format("Generic error <%s>",e.getMessage())); |
}
|
|
try { |
final QueryResult result = cluster.query("CREATE PRIMARY INDEX default_profile_index ON "+props.getBucketName()+"._default."+ CollectionNames.PROFILE); |
for (JsonObject row : result.rowsAsObject()){ |
System.out.println(String.format("Index Creation Status %s",row.getObject("meta").getString("status"))); |
}
|
} catch (IndexExistsException e){ |
System.out.println(String.format("Collection's primary index already exists")); |
} catch (Exception e){ |
System.out.println(String.format("General error <%s> when trying to create index ",e.getMessage())); |
}
|
We tried on multiple languages and we always get the same error:
{"completed":true,"coreId":"0x1345501c00000001","errors":[{"code":12003,"message":"Keyspace not found in CB datastore: default:user_profile._default.profile"}],"idempotent":false,"lastDispatchedFrom":"127.0.0.1:63120","lastDispatchedTo":"localhost:8093","requestId":13,"requestType":"QueryRequest","retried":0,"service":{"operationId":"526fcd12-023b-4628-a510-1a250794725c","statement":"DELETE FROM user_profile._default.profile ","type":"query"},"timeoutMs":75000,"timings":{"dispatchMicros":1132,"totalDispatchMicros":1132,"totalMicros":1952}} |
|
But if we add a sleep of 10 seconds, the code works fine. Ideally, the SDK should only send the acknowledgment after the collection is created.
Attachments
Issue Links
- relates to
-
MB-11484 Implement a generic mechanism to observe completion of any changes requested by REST API requests. Must work for all port 8091 APIs
- Open
-
MB-50303 Support for synchronous execution of DDLs in Indexing
- Open
-
MB-48059 Delete bucket times out waiting for no nodes
- Closed
-
MB-48063 ns_server should do a quorum read on collection manifests before performing checks
- Closed
-
PCBC-767 Creating Scope gives "Failed to decode value as JSON:" warning and silent fail.
- Resolved
-
PYCBC-1134 Errors when trying to create bucket, collection, and index with 7.0 beta and Client SDK
- Closed
- links to