Remove useless condition.

It's already covered by preceding clause.

Change-Id: I7b4a2332fe416ce728b50172bad01663563828b3
Reviewed-on: http://review.couchbase.org/38274
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Remove unused include.

Change-Id: I058f55b6d622462df80e1ba57f15a5b9643017c5
Reviewed-on: http://review.couchbase.org/38275
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
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>
MB-10954 Use needs_rebalance when deciding on failover warnings.

So that we (almost) always show a warning when rebalance button is
enabled. The difference is in the set of nodes we pass to the
function. For the sake of failover safety warnings we pass only active
nodes. This helps us avoid a duplication of information that's shown to
the user. Specifically, otherwise we'd show a warning when the user just
adds a node to a cluster without hitting rebalance.

Change-Id: Ib5627b51919db2e7c1077f18d74e1c78e755f76b
Reviewed-on: http://review.couchbase.org/38280
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Allow to search for trivially matching past vbucket maps.

Where by "trivial" I mean:

  - nodes sets of past map and current map are the same
  - tags might be renamed but if two nodes were on the same tag before
  renaming they must reside on the same tag after the renaming.

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