DESCRIPTION

JVMCBC-369: Gracefully handle empty partitions in bucket config.

Motivation
----------
If, for example during warmup, or for some other reason the bucket
config from the server does not contain partitions the code should
gracefully handle this case and send it into retry as it is done
under similar conditions.

Modifications
-------------
The code now checks if IndexOutOfBounds is raised and if so it returns
-2, which is also used for replica operations when the replica is not
even in the config. This allows for consistent handling and doesn't
involve changing much of the logic.

If the locator gets this -2 from the config, it sends the op into the
retry or cancel queue, since we can't dispatch the op right now,
waiting for a new config to arrive.

Result
------
Gracefully handle the situation where the server sends us a config but
it doesn't contain any partitions.

Change-Id: I69ca745adbb02b1a04e3f9c1c51b730a41339cf6
Reviewed-on: http://review.couchbase.org/68261
Reviewed-by: Cory Peck xxx@xxx.xxx
Tested-by: Cory Peck xxx@xxx.xxx
Reviewed-by: Marques Ellis xxx@xxx.xxx


COMMENTS

author: Gerrit Code Review
date: 2016-10-03 15:13:27.659000000

Change has been successfully cherry-picked as c4044e4d23056789868d785fe93ca5203dc9b821 by Natasha Sullivan

-------------------------------------
