MB-12037: don't loose replicas on stopped vbucket switch moves

The issue observed in MB-12037 is old bug in ns_janitor where it would
lose replicas after completed move if old master is among replicas of
new chain.

This fixes the problem and adds unit tests for this and related cases.

Change-Id: Ie6b19cd87230a3594d8953216b2749aed7e8ce9f
Reviewed-on: http://review.couchbase.org/40803
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
AngularJS: improvements of wizard steps

include:
- async caching of html partials
- spec fixes
- bug fixes
- transition from wizard to overview

Change-Id: I64317aebd5f6d3d0a33a849ce82f06f5c0d393eb
Reviewed-on: http://review.couchbase.org/38738
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
AngularJS: index controller test

Change-Id: I7acfae716f74e28d028bd2ce374f4ab56f5f1ca7
Reviewed-on: http://review.couchbase.org/40575
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
AngularJS: MB-11954: existing default bucket during wizard setup

Change-Id: If2f00b95a4b232c7b7744c58ccbaa61641ec6b01
Reviewed-on: http://review.couchbase.org/40619
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
AngularJS: use serializeData for converting params to xhr format

Change-Id: If58e141f8f0fb932cdfa3d2395ceaec0bbad8473
Reviewed-on: http://review.couchbase.org/40697
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
AngularJS: relooking of spinner directive

Change-Id: I4b209c042783bb1c5b7ee98258d257d7818452c5
Reviewed-on: http://review.couchbase.org/40698
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
AngularJS: restructuration of application

Change-Id: I83e8b8689eedf36e69c5d159e3e23dfd726344d7
Reviewed-on: http://review.couchbase.org/40748
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-12055: don't lose replica in other case of repl.-master switch

Previous fix in this area always expected past master to be dead. But
this was incorrect because rebalance may be stopped after updating
vbucket states to their post-move values, but prior to updating
vbucket map.

New fix takes this possiblity into account.

Change-Id: I31c2874f44d8257922f6474a5f021155ae8f92e7
Reviewed-on: http://review.couchbase.org/40886
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-12075: refresh vbucket_map_mirror cache on ssl port updates

Stale cache was causing node .218 to send node .225 node info without
couchApiBaseHTTPS field. Which caused continous crashes on other
cluster.

It looks like cache was stale because we did not refresh it on ssl
capi port updates.

Change-Id: I56c9e7bdcfc9b82cab832ecec7b9312fc776875d
Reviewed-on: http://review.couchbase.org/40949
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Artem Stemkovski <artem@couchbase.com>
MB-12075: dont crash remote_clusters_info on missing couchApiBase

Our code had assertion that couchApiBaseHTTPS must always exist if
remote cluster's is configured with certificate.

It is usually true that cluster that supports xdcr-over-ssl has all
nodes with couchApiBaseHTTPS. But in this case due to stale cache we
saw one node sending us node info without couchApiBaseHTTPS. Which
caused assertion to crash remote_clusters_info. Which led to
max_restart_intensity_reached.

This commit refactors remote_clusters_info so that extract_node_props
and related functions really error out on missing important fields.

Change-Id: Id62b15ed73ae04b19420bd70b042af3b4049adad
Reviewed-on: http://review.couchbase.org/40953
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-11722: Don't set couch_port when creating a bucket

We're removing the couch notifier from ep-engine so this
parameter is no longer valid.

Removed unused parameter: couch_port

Change-Id: I8fa97838b1b539f718c1f001875002dd4996e2cc
Reviewed-on: http://review.couchbase.org/38834
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Artem Stemkovski <artem@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
remove mc_couch related code

not needed anymore since couch notifier is removed from ep_engine

Change-Id: Id6f7cc228b36b63a9ccf83a8d97842c712d015ba
simplify child_erlang:open_port_args

Change-Id: Ic1461f74a40d15342b9340dafd5ae25c0e8fdcfe
fix and use ns_config_replica:get_compressed

Change-Id: I7db8172e035ffb0ea873b76e74cad0f0fd470eba
allow to initialize config by pulling it from another node

we also need to replace the destination node with target node
in all node dependent keys in order for calls like search_node to
work correctly

Change-Id: Iab868bc5cfac5372c273ba29ff615dd58d0af58d
initial implementation of couchdb node with the copy of config

no config replication yet

Change-Id: I934f5cd8e601cf1a830af9a96b060777748f1762
config replication from ns_server node to couchdb node

Change-Id: Iae84c24bdb0cdecefaf0566b9c1459ae0b759109
make single_bucket_sup a parameter in ns_bucket_worker_sup

so the same supervisors can be reused for couchdb node

Change-Id: I8a753e5ec8cee5cfab6c581ba710e7d80d718b02