Don't enable replica index checkbox when editing bucket settings.

Change-Id: I8871188835913b4ada9801fd06146cc3790d35ec
Reviewed-on: http://review.couchbase.org/38276
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-11295 Refetch remote cluster when reference changes.

Specifically when node from reference is not in the cached list of
nodes. Note that we do this only when remote bucket is fetched and
there's no cached version of it. But that should be fine, because if
cached version is inconsistent and causes replicator to crash, it will
invalidate the cache.

Change-Id: I551aba0ec22e270f3fdd2145be5663231b99c7fe
Reviewed-on: http://review.couchbase.org/38277
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-11074 Detect unbalancedness when some nodes have no vbuckets.

Change-Id: I7b0eba85a120f8e665be7d09695f4e1fe7b348e7
Reviewed-on: http://review.couchbase.org/38278
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Move bucket_needs_rebalance/3 function to ns_bucket.

Change-Id: If04d48bb17177b35b254f1ad257e48b05e52490e
Reviewed-on: http://review.couchbase.org/38279
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>