Details

Description

While running a sequence of getsAsync operations, the entry point/bootstrap node is failed over. The output follows

Exception in thread "SDK Handle-8" java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.ArrayList.elementData(ArrayList.java:338)
at java.util.ArrayList.get(ArrayList.java:351)
at com.couchbase.client.vbucket.config.DefaultConfig.getServer(DefaultConfig.java:81)
at com.couchbase.client.vbucket.VBucketNodeLocator.getPrimary(VBucketNodeLocator.java:74)
at com.couchbase.client.CouchbaseConnection.addOperation(CouchbaseConnection.java:144)
at net.spy.memcached.MemcachedConnection.enqueueOperation(MemcachedConnection.java:639)
at net.spy.memcached.MemcachedClient.asyncGets(MemcachedClient.java:888)
at net.spy.memcached.MemcachedClient.asyncGets(MemcachedClient.java:902)
at com.couchbase.sdkd.cbclient.GetCommandContext.doOneCommand(GetCommandContext.java:60)
at com.couchbase.sdkd.cbclient.CommandContext.execute(CommandContext.java:266)
at com.couchbase.sdkd.server.SdkServer.executeCommand(SdkServer.java:114)
at com.couchbase.sdkd.server.SdkServer.handleRequest(SdkServer.java:133)
at com.couchbase.sdkd.server.SdkServer.run(SdkServer.java:187)

An exception is now raised, because a vbucket master of -1 means that no server is able to respond for the given key. This is a strong indication of data loss. This could be the case because no replica was defined and a node was failed over or more nodes have been failed over than replicas defined.

Either way, the client itself has no chance of dealing with the situation and therefore populates a controlled exception up to the caller.

Michael Nitschinger
added a comment - 09/Nov/12 10:16 AM An exception is now raised, because a vbucket master of -1 means that no server is able to respond for the given key. This is a strong indication of data loss. This could be the case because no replica was defined and a node was failed over or more nodes have been failed over than replicas defined.
Either way, the client itself has no chance of dealing with the situation and therefore populates a controlled exception up to the caller.
The fix has been pushed to master and will be available in dp5.