Description
I've been running a quite heavy kv workload and rebalancing kv nodes in and out (using 3.0.0). Not always, but sometimes I see an exception like:
Couchbase.NodeNotAvailableException: Cannot find a Couchbase Server node for 10.143.194.101:11210.
|
at Couchbase.CouchbaseBucket.SendAsync(IOperation op, CancellationToken token, Nullable`1 timeout)
|
at Couchbase.KeyValue.CouchbaseCollection.UpsertAsync[T](String id, T content, UpsertOptions options)
|
at sample.Program.Main(String[] args) in /Users/michaelnitschinger/couchbase/code/dotnet/sample/Program.cs:line 19
|
-----------------------Context Info---------------------------
|
null
|
So it seems that the SDK is not handling a state transition when nodes come and go properly (i.e. grabbing a new config and rescheduling the op transparently). Interestingly in the case above, the IP address was not one that I actually added or removed (10.143.194.101 was steady, in this case I added 10.143.194.102 in, but I've also seen it on rebalance out).
Code was rather trivial:
static async Task Main(string[] args)
{
var cluster = await Cluster.ConnectAsync("couchbase://10.143.194.101", "Administrator", "password");
var bucket = await cluster.BucketAsync("travel-sample");
var collection = bucket.DefaultCollection();
while (true) {
for (int i = 0; i < 1024; i++) {
try {
var upsertResult = await collection.UpsertAsync("doc1" + i, new {Name = "Ted", Age = 31});
var getResult = await collection.GetAsync("doc1" + i);
} catch (Exception e) {
Console.WriteLine(e);
}
// Console.WriteLine(getResult.Cas);
}
}
}