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>
AngularJS: display spinner by default

Change-Id: Iba2072cd1202c52f2b298d5a3a1178a1f917fc6c
Reviewed-on: http://review.couchbase.org/40869
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-12056: don't crash on update of bucket with invalid authType

In MB-12056 it looks like second submit is somehow triggered. And that
second submit sees form input disabled which causes post with invalid
authType. The later caused other_buckets_ram_quota property to be
undefined which crashed menelaus_web_buckets:interpret_ram_quota.

We now anticipate this undefinedness which fixes the problem.

Change-Id: Ia2b5b51097a5cab53c36677a441fc0096d69f48b
Reviewed-on: http://review.couchbase.org/40889
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
hooks.js: fixed stats for only-web

Change-Id: I76cd19149aafe4bca7c5a902d4c7c0b5314d4121
Reviewed-on: http://review.couchbase.org/41006
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Pavel Blagodov <stochmail@gmail.com>
Tested-by: Pavel Blagodov <stochmail@gmail.com>
[cells.js] added debugger call into future start exception path

Change-Id: Ie13d76f436a7c698f545a3e38eb9864003ddf5c0
Reviewed-on: http://review.couchbase.org/41007
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Pavel Blagodov <stochmail@gmail.com>
Tested-by: Pavel Blagodov <stochmail@gmail.com>
made bucketsListCell.refresh work even if nothing has changed

Which is important for hooks.js which always returns same stuff.

I.e. previously because we subscribed on bucketsListCell which uses
_.isEqual for equality we ended up not calling callback in hooks.js.

Now we subscribeOne on rawDetailedBuckets which has object identity
equality which causes refresh callback to work.

Change-Id: Ia5077e156426645368c760df2ad131914e37b8d3
Reviewed-on: http://review.couchbase.org/41008
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Pavel Blagodov <stochmail@gmail.com>
Tested-by: Pavel Blagodov <stochmail@gmail.com>
refactored hooks.js into mn-hooks.js that is not tied to jquery

So that we can use it for Angular based UI.

As part of that work some responses were actually fixed. Like addition
of evictionPolicy to bucket details. Lack of which caused UI to crash.

Change-Id: Id34e6ddc1aa4402aec9096c06a5b2d27c96aa5b6
Reviewed-on: http://review.couchbase.org/41009
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Pavel Blagodov <stochmail@gmail.com>
Tested-by: Pavel Blagodov <stochmail@gmail.com>
MB-12062: updated doc link to point to future 3.0 manual place

Change-Id: Ia0658c2b3f226c5ec01a7eb0e068df0506ae8f20
Reviewed-on: http://review.couchbase.org/41057
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Merge remote-tracking branch 'rel-3.0.0'

* rel-3.0.0:
  MB-12062: updated doc link to point to future 3.0 manual place

Change-Id: I92a301506cd11d904f01b8ece3069ed760f255a9
remove mc_couch related code

not needed anymore since couch notifier is removed from ep_engine

Change-Id: Id6f7cc228b36b63a9ccf83a8d97842c712d015ba
Reviewed-on: http://review.couchbase.org/41000
Tested-by: Artem Stemkovski <artem@couchbase.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>