MB-9408: able to set outline color and title of window

Change-Id: I9f80a2bd6034783173702b6072d69b829bb0ff10
[alk@tut.by: adjusted hooks.js]
[alk@tut.by: disallow visual settings POST for ro admin]
Signed-off-by: Aliaksey Kandratsenka <alk@tut.by>
Reviewed-on: http://review.couchbase.org/30694
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
missed memoryQuata in hooks.js

Change-Id: I77a62f9addbbc1d57ee54b43dc319b77636595aa
Reviewed-on: http://review.couchbase.org/30994
Reviewed-by: Pavel Blagodov <stochmail@gmail.com>
Tested-by: Pavel Blagodov <stochmail@gmail.com>
MB-100: add type in concurrency throttle

Concurrency throttle is a generic service and components may create
their own throttle processes, e.g., in XDCR, there are two types of
concurrency throttlesP init throttle and replication throttle. But
without type in throttle state, it would be hard to make enchancement
such as adaptive scheduling and differentiate traces in logs from
different throttles.

Change-Id: I075df7db1dfc7b0e48448e26fa3bd08ef401f97a
Reviewed-on: http://review.couchbase.org/30945
Reviewed-by: Junyi Xie <junyi.couchbase@gmail.com>
Tested-by: Junyi Xie <junyi.couchbase@gmail.com>
MB-9477: changed text for Metadata Purge Interval

Change-Id: I50038a5ea64b89609daf4b28ed53cc88d07f4ffe
Reviewed-on: http://review.couchbase.org/30992
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-9477: converter from short to full decimal representation

Change-Id: I8b28c2715f681c24531e5b0eb0db64e2a6018cff
Reviewed-on: http://review.couchbase.org/30993
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-100: ignore irrelevant src_db_updated msg

Today for some reason unknown, XDCR will receive src_db_updated
msg for a vbucket the bucket replicator does not care. For example
in a 2-node cluster, one node responsible for replicating all
vb 0 through vb 511, but it also receives source db update msg
for vb 512 through vb 1023, which spam the logs with useless
information and make valid trace difficult to find.

Change-Id: I42db9fc60ef72763ceb9b259c27774ac1d28fab5
Reviewed-on: http://review.couchbase.org/30975
Tested-by: Junyi Xie <junyi.couchbase@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-100: skip unchanged vb map chagne msg

Today for some reasons unknown, bucket replicator will receive
"buckets" msg even without vbucket map changes. Althogh it has
no effect to onging replication but it unnecessarily dumps the
unchanged active vbs as "vbucket map chagned", making misleading
traces in logs. This commit would ignore such msg.

Change-Id: I0c4fed95164bfd6e44026e2bb73eb23d43543322
Reviewed-on: http://review.couchbase.org/30976
Reviewed-by: Junyi Xie <junyi.couchbase@gmail.com>
Tested-by: Junyi Xie <junyi.couchbase@gmail.com>
MB-100: enforce retry on every memached error in XMem

Original design will tolerate 10 memcached errors in a batch
without crashing and retry from earlier sequence number. The
intention was to prevent occasional memcached errors from
blocking replication at the cost that some items may not get
replicated.

By talking to support staff, this may not be the best way and
the top priority is to make data synced up on both sides without
missing any mutation. Therefore this fix will make replicator
retry on every memcached error.

Change-Id: Ia30b6e29ec3905f6d8ded8c461e010a2a35f2c90
Reviewed-on: http://review.couchbase.org/30995
Reviewed-by: Junyi Xie <junyi.couchbase@gmail.com>
Tested-by: Junyi Xie <junyi.couchbase@gmail.com>
Capture more memached errors in XMem

It turns out that in analyze customer issues, current logging of
memcached error is not enough. We may hit etmpfail and enomem but
they are categorized as "other" in logs. This commit will dump such
errors. Also, it uses dict to catebgorize memcached errors.

We should be able to do better when hit etmpfail, but given current
pipeline model, there is no straighforward way we can backoff and
re-replicate from mutation with etmpfail. Mutation order need to be
observed instead of just replicating these  mutations with etmpfail.
Will handle that in future.

Change-Id: I18d49194ad81281ca7aa566a4d04fa7bcb43783a
Reviewed-on: http://review.couchbase.org/30998
Reviewed-by: Junyi Xie <junyi.couchbase@gmail.com>
Tested-by: Junyi Xie <junyi.couchbase@gmail.com>
MB-100: fix incorrect variable name

Change-Id: I8b34ba5deff2fdfa7f99a9daf779e0f5674ca630
Reviewed-on: http://review.couchbase.org/31012
Tested-by: Junyi Xie <junyi.couchbase@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-9711: send non-terse streaming bucket details by default

It was found that not all SDKs can tolerate terse streaming bucket
details. So we have to return conservative defaults.

There's however ns_config option that enables sending terse streaming
bucket details.

Change-Id: I279c99a5db8eaa89b27cc11e428a6b440bce8c30
Reviewed-on: http://review.couchbase.org/31024
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
correct typespec for ns_orchestrator:update_bucket

Change-Id: Iddeb99e0568b7126765cbcb32493056b9ba21d7f
Reviewed-on: http://review.couchbase.org/31025
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
corrected typespect in xmem worker

Change-Id: Icf935d3a2dcd1395e8c921ffde165d2daf7a580f
Reviewed-on: http://review.couchbase.org/31026
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-9652: never rename a node on cluster leave

In order to workaround what increasingly appears to be erlang VM
deadlock we're going to avoid renaming node even if has user-supplied
address.

Original intention of that was to allow transition from manual ->
automatic ip address. Which would be otherwise impossible. I.e. in
2.1.0 once node had manually assigned address, there was no way to
change it to automatic address management.

We preserve that logic and avoid renaming node by simply taking
current manually assigned address and saving it as automatically
assigned. Thus still switching into automatic address management mode
on cluster leave.

Change-Id: I98d9d2bb152db80ac1a5c97ebb4761e6179c7003
Reviewed-on: http://review.couchbase.org/31029
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-9714: use bucket's nodes to get count for storage totals

Change-Id: I3241c6079b57eccb896053cc1b4453384fec2040
Reviewed-on: http://review.couchbase.org/31030
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-9524: updated doc link

Change-Id: Ia3bfcc52310d54c03bf3a92ee4813fefe3a1a697
Reviewed-on: http://review.couchbase.org/31015
Reviewed-by: Pavel Blagodov <stochmail@gmail.com>
Tested-by: Pavel Blagodov <stochmail@gmail.com>
MB-9477: amended text for Metadata Purge Interval

Change-Id: I8d564e701420fa34b69547ef16bc91bf45dcbba7
Reviewed-on: http://review.couchbase.org/31016
Reviewed-by: Pavel Blagodov <stochmail@gmail.com>
Tested-by: Pavel Blagodov <stochmail@gmail.com>
MB-9725 Factor out a function to determine old map compatibility.

Change-Id: I42bbe42f736a60c28367133aed33b6d17435b36f
Reviewed-on: http://review.couchbase.org/31062
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-9725 Handle tags when looking for matching renamings.

In the presence of tags it's not enough to find nodes that can be
swapped. It's also important to check that tags after renaming are
compatible with currently set tags.

The tags themselves are now ignored when a past map is considered for
compatibility. And then matching_renaming_with_tags will just ignore
the map if it's incompatible.

Change-Id: Iea35215ad0558cf1de26731576e6057200ecff32
Reviewed-on: http://review.couchbase.org/31063
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-9725 Ignore map options when updating vbucket map history.

When putting some vbucket map to the history the only thing we are
interested is actual balancedness of the vbucket map. We are not
interested if map options are the same or different from current
ones. As long as the map is balanced, it can be used in conjunction
with its own options. For example, when bucket is created and new map
is generated, previous version of ns_rebalancer:unbalanced would
consider this map unbalanced just because bucket config doesn't have
map_opts_hash in it. Same is true for the upgrade case where we put
current buckets' maps to the history (though ns_rebalancer:unbalanced
had a special case for this).

So I factored out ns_rebalancer:map_options_changed function out of
ns_rebalancer:unbalanced. And I call it only in places where it
actually matters.

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