DESCRIPTION

JVMCBC-68: fix node pickup on rebalance

Motivation
----------
When a rebalance occurs, the client fails to pick up changes in nodes
list and will stay in a state where no data operation succeed.

This is due to a race condition where the Locator's list of Nodes is
out of date with the atomically updated configuration host array.

This results in an IllegalStateException because we look for a Node
(from the configuration) not contained in the Nodes List.

Modifications
-------------
In the Locator, we check if the list of Nodes has a different size than
the configuration's partitionHosts list. If so, we just reschedule the
request by returning an empty Node array.

Result
------
Operations continue (at a much much lower pace) during the failover and
once the nodes are added back, they are picked up immediately. Then the
operations ramp up during rebalance and everything gets back to normal.

Change-Id: I9dad2cb30aba49d62cf65370d83559d2f8f6038f
Reviewed-on: http://review.couchbase.org/43401
Tested-by: Estrella Humphrey xxx@xxx.xxx
Reviewed-by: Natasha Sullivan xxx@xxx.xxx


COMMENTS

author: Natasha Sullivan
date: 2014-11-19 11:57:32.255000000

Change has been successfully cherry-picked as 14efb13c4fdb42f17ec4fa7a67b72e92814fec8e

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