MB-5678: cbcollect_info invokes cbstats with its changed params

Change-Id: I2639efc0604386ad9c66c35e58f2d082bf0d9a7e
Reviewed-on: http://review.couchbase.org/17595
Tested-by: Farshid Ghods <farshid@couchbase.com>
Reviewed-by: Farshid Ghods <farshid@couchbase.com>
MB-5307 Fix xdc_replicator_worker:flush_docs error log message.

Seems that it's been a long time since couch_api_wrap:update_docs
stopped converting remote error messages to something that looks
exactly like local error messages. Thus instead of atoms one should
look up corresponding binaries in a parsed object.

Change-Id: I30536220419d52b2a84530e06f700f2272d20128
Reviewed-on: http://review.couchbase.org/19323
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-5307 Strip too long error messages in flush_docs.

It seems that our error reasons can be particularly long (for
instance, they can include the whole document body in some cases). As
a safety precautions against spamming the log we'll strip those
messages to something more reasonable.

Change-Id: I2ce92b46421b915ee67d34f0c0057e78c69f235d
Reviewed-on: http://review.couchbase.org/19324
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
CBD-423 Resurrect set_view_update_daemon in ns_server.

Configuration parameters were moved to ns_server config. Update
interval can only be specified globally for all design
documents. Minimum number of changes to update the index can be
specified globally and on per design document basis. For the latter
one should set "updateMinChanges" integer field in "options" object in
design document body. This value will override a global value.

updateMinChanges value of 0 (either global or per ddoc) means that
update won't be triggered for this ddoc (or for all ddocs). But the
daemon will still periodically try to trigger updates.

To disable daemon completely updateInterval should be set to 0.

For simplicity the code behaves as if there were no design
documents with the same signature. In reality if there happen to be
several design documents with the same signature, then update will be
triggered whenever at least one design document's updateMinChanges
value is less than the number of changes.

Change-Id: Idcc2c4e62bd76160f4475c407d1d06bfe6ec8e8d
Reviewed-on: http://review.couchbase.org/19260
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
CBD-423 REST API to alter set view update daemon parameters.

Change-Id: I0baeb6d0235f6245c50bbc2d5b78d8f0129ce8bc
Reviewed-on: http://review.couchbase.org/19262
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
CBD-423 REST API to update per ddoc updateMinChanges.

Change-Id: I61fa08b0fd90039b75e41d53140a8cc734e5f07f
Reviewed-on: http://review.couchbase.org/19264
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-5307 Add compaction_daemon settings to config on upgrade.

Change-Id: Ia4b9b9f912b8a84228b29116aee6940adbeee91b
Reviewed-on: http://review.couchbase.org/19265
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-5307: Update CodeMirror to version 2.32

Change-Id: I14847fc649e487e57afc3765517b0f26cd35da68
Signed-off-by: Aliaksey Kandratsenka <alk@tut.by>
[alk@tut.by: added ticket reference]
Reviewed-on: http://review.couchbase.org/19442
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-6171: sample document and CodeMirror improvements

Change-Id: I4204284fef06590ee42b27f48555b722987f505b
Reviewed-on: http://review.couchbase.org/19443
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-6162: inform user whether swap rebalance happens

While implementation doesn't seem to correctly detect 'remove after
failover' case it seems to detects 'pure' swap rebalance correctly.

Change-Id: Ic3978528b7df7fc64d9371cf38610daf32759310
Reviewed-on: http://review.couchbase.org/19447
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-5308: made edit view link fill larger space

So that it's much easier to hit it. I.e. I don't have to aim for text.

Change-Id: I24f3b5ee3891ee75a915484c6e7416d7a981c047
Reviewed-on: http://review.couchbase.org/19280
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-5308: dont double-escape view filter 'link'

Change-Id: I6f6f9483615e136bc3b1b10ec4a5d245c02a98d7
Reviewed-on: http://review.couchbase.org/19439
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-5307: deleted obsolete & outdated tests

Change-Id: I73528ec207bf2abfae66bf1a34671f1e4a1fa184
Reviewed-on: http://review.couchbase.org/19440
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-5307: improved typespec of ns_memcached:create_new_checkpoint

Change-Id: Id4985ed2f60823ea2ef9ebcd1867c637440daeb5
Reviewed-on: http://review.couchbase.org/19343
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-5895: consider upgrading vb map history at rebalance start

When 1.8.1 is added to cluster of 1.8.0 nodes there's initially no
vbucket map history. This happens because 1.8.1 currently considers
upgrading config only when offline upgrading. But for vbucket map
history which is global config element, we need to do that with actual
vbucket maps (after joining cluster) but before rebalance, so that
swap rebalance works.

Change-Id: I1757f869b5542b06ccf0951d8827e21963f1c0cc
Reviewed-on: http://review.couchbase.org/19387
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-5555: New logging and log rotation for memcached.

Change-Id: I2c462922a9b6b15a646016c46946f8bb72fb967e
Reviewed-on: http://review.couchbase.org/19397
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-5307: clean replicator database when leaving cluster

Because otherwise we "leak" old and invalid stuff.

Change-Id: I889a01572c81c97e6811d4628ff3e9c486ebae98
Reviewed-on: http://review.couchbase.org/19471
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-6182: Revert "MB-5307: Update CodeMirror to version 2.32"

This reverts commit 45a92eaa892d71e01241b0bbf95addd23d72328f.

Change-Id: I2589bd65154ec102c00c9799f1392b9a00f1feb8
Reviewed-on: http://review.couchbase.org/19472
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-100:Merge branch 'branch-181' into branch-18

* branch-181:
  MB-5895: consider upgrading vb map history at rebalance start
  MB-5678: cbcollect_info invokes cbstats with its changed params

Change-Id: I292cedb61a9bf00676b73ab864c6e6c29647ff41
MB-100: Merge commit 'f2930c1e14310a95fc4f7fd14275f53685babdf0'

* commit 'f2930c1e14310a95fc4f7fd14275f53685babdf0':
  MB-5678: cbcollect_info invokes cbstats with its changed params

Conflicts:
	cbcollect_info

Change-Id: Icf4cf66feaef2d8d9f60c9846e137463bbb1e893