MB-9501: protocol column for ongoing replications list

Change-Id: If7d232e3f8a562a33fd3b917191c4622074e9197
Reviewed-on: http://review.couchbase.org/30713
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
added colons to replication advanced settings labels

Change-Id: I26c41b4ae614e920b2ebf674c50ca7981038e4df
Reviewed-on: http://review.couchbase.org/30714
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-6983: binary and decimal prefixes

extension of truncateTo3Digits is necessary because
we can get 1000K instead of 1M in some cases

Change-Id: Ib747e076e47d6e5f6b87deadd41ad26c247abfc7
Reviewed-on: http://review.couchbase.org/30214
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-9644: do not allow updating bucket during rebalance

Otherwise our attempt to request janitor run for possible update of
replicas count crashes rebalance.

Change-Id: Iadf03e117cb35e7ab311d353a1a252e771873857
Reviewed-on: http://review.couchbase.org/30878
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-100: log loaded replication documents

I.e. to make diagnosing issues like MB-9647 easier.

Change-Id: I35c5973367738a2c606b0812c4343e01d83b000a
Reviewed-on: http://review.couchbase.org/30879
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-9548 delete all replications from the bucket

... before deleting the bucket

Change-Id: I4fc0f81ed243ebbb2bed99cb79865bf403e68026
Reviewed-on: http://review.couchbase.org/30750
Tested-by: Artem Stemkovski <artem@couchbase.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-9663: add to bucket active vb table when starting vb replicator

Today when we start new vb replicator, we do not add it immediately
to the active vb table in bucket replicator, instead, after the vb
replicator finishes initialization, it would report status to bucket
replicator and an entry will be created in the active vb replicator
table within bucket replicator.

This small init time lag may cause issue in corner cases, e.g., when
a vbucket just has one mutation, we may lose this single notification
from couchdb (src_db_updated) because the corresponding vb replicator
has not finished initialization and bucket replicator cannot find its
Pid to relay the notification msg. As a result, this vb replicator
may not be wakened for a long time until next mutation to this vb
arrives. We also see msgs like "get src_db_udpated from vb 12, but
the vb replicator has not initialized yet" in logs.

This fix will add new vb replicator immediately to active vb rep
table in bucket replicator with an empty status entry (but including
the Pid of the new vb replicator). Then all subsequent src_db_updated
msg from couchdb will be captured and relayed to corresponding vb
replicator.

Change-Id: Iba2251065cd3def37d2bf7b3017d1767a23238f9
Reviewed-on: http://review.couchbase.org/30893
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-100: increased default autofailover timeout to 2 minutes

Because it turns out many folks dont have environments that can
reliably avoid false positives with 30 seconds.

Change-Id: I4119a31b29a0a647628a6d0957ae478b0dc90662
Reviewed-on: http://review.couchbase.org/30905
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Merge remote-tracking branch 'origin/for-rackaware'

* origin/for-rackaware:
  MB-100: increased default autofailover timeout to 2 minutes
  MB-9663: add to bucket active vb table when starting vb replicator
  MB-9548 delete all replications from the bucket
  MB-100: log loaded replication documents
  MB-9644: do not allow updating bucket during rebalance
  MB-6983: binary and decimal prefixes
  added colons to replication advanced settings labels
  MB-9501: protocol column for ongoing replications list
  MB-9679 Treat star and chain maps compatible if num_replicas=1.
  MB-9678: require rebalance after offline upgrade
  Handle non kv-list error_logger reports.
  MB-9652: avoid restarting net_kernel unless absolutely necessary
  Print for how many vbuckets rack constraints are broken.
  added script to validate vbmap rack awareness constraint

trivial merge

Change-Id: Ib8d0cef9e0c8642df2202041add1dd9e8f7c76d7
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>