DESCRIPTION

JVMCBC-432: Fix hostname fallback in MDS environment

Motivation
----------
Couchbase terse config might skip "hostname" property of entries in "nodesExt",
when the node configured on localhost. To mitigate that, SDK tries to fetch
hostname from "nodes" array. In MDS environment, where not every node has
Data service, falling back "nodes" array will have only entries where Data
service has been enabled, which leads to IndexOutOfBoundsException during
aforementioned fallback mechanism

Modifications
-------------
Only pull hostname from "nodes" array, when its size matches "nodesExt", because
only in this case we can be sure that we addressing the same node's information.
If the size does not match, the only option we have is to fallback to "localhost".

Result
------
SDK works with MDS clusters created by ns_server/cluster_run.

Change-Id: Ie1c146105eea311660ae252ab737e97801bc7ec7
Reviewed-on: http://review.couchbase.org/80214
Tested-by: Cory Peck xxx@xxx.xxx
Reviewed-by: Natasha Sullivan xxx@xxx.xxx


COMMENTS

author: Cory Peck
date: 2017-07-03 08:26:02.750000000

Change has been successfully cherry-picked as 14d06355fc84a343bbc5cdf47ffdc6fd20c0fcd3 by Cory Peck

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