MB-11435: removed unnecessary xdcr logging from hot path

Change-Id: Ib587a2e22d867f901d322fa960d99ddf18af146a
Reviewed-on: http://review.couchbase.org/39189
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-11631 Ensure terminate is called if ensure_bucket succeeds.

Change-Id: I74af9bd5a47d2eea3054f73d9fe11b8e10103a7b
Reviewed-on: http://review.couchbase.org/39197
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-11435: implemented new concurrency throttle

New throttle implements more or less round-robin scheduling of
workers, which is different from "least loaded destination" of
existing concurrency throttle. But new throttle is built to be faster.

Change-Id: I8577357070028a3a77f43a3913fd77562a877263
Reviewed-on: http://review.couchbase.org/39190
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-11435: made old concurrency_throttle to behave as new throttle

I.e. so that we can send same calls and casts to both throttle kinds
and expect things to work.

Change-Id: Ic1fba0b5a8000dff2cd29f22cc617a024f94f327
Reviewed-on: http://review.couchbase.org/39191
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-11435: switch to new concurrency throttle

There is now ns_config variable that allows us to pick old concurrency
throttle.

You can choose old concurrency throttle by /diag/eval-ing this:

ns_config:set(xdcr_use_old_throttle, true).

Change-Id: I194ce4b6e7d22cd8d573913ec2c292a966c3bbbe
Reviewed-on: http://review.couchbase.org/39192
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Remove one of many unused functions in misc module.

Change-Id: Id03929f85aa3ad725b5be25198f0987fd92c8c44
Reviewed-on: http://review.couchbase.org/39226
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-11608 Don't require halt() to complete outstanding IO.

This was the default in R14.

Change-Id: I837b2a22a6f78d8c73ed8ac8d529bb98784f1596
Reviewed-on: http://review.couchbase.org/39227
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Fallback to regular halt/1 if halt/2 is undefined.

Which is the case in R14.

Change-Id: I205fa969d93ae1e313d05c23539214c95b9c103a
Reviewed-on: http://review.couchbase.org/39228
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
[cbcollect_info] MB-11671 adding ss lshw and /proc/net/dev outputs

Change-Id: I6ab3f566c64ceceefd916375b0d1582c16f63e22
Reviewed-on: http://review.couchbase.org/39267
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-11710: Expand error message when attempting 1.8.1 join

Tell the user how to fix the failure to join.

Change-Id: Iab2b520ebbb4ebddeacb1903003631adcc2b2e44
Reviewed-on: http://review.couchbase.org/39314
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-11699 Use HTTP status code to detect successful upload.

curl doesn't indicate HTTP errors by setting non-zero exit status
unless --fail flag is used. The latter though said to be unreliable in
the man page. So we ask curl to print http status code to stdout and
use it to detect if upload was successful.

Change-Id: I333ff7ca416989b3c88eac8e926c9bb4451b3959
Reviewed-on: http://review.couchbase.org/39331
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-11697 Use finite timeout for pre-collection HEAD request.

Change-Id: I79bb78888396e5725f4731dd6438559fff15e50b
Reviewed-on: http://review.couchbase.org/39357
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
[ale] Flush disk sink buffer when sync is called.

Change-Id: I90840b4bf597f4e2e55d84ff6fa2f84a374e7076
Reviewed-on: http://review.couchbase.org/39365
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
[ale] sync sinks when application terminates.

Change-Id: I829bde302939412b29522126ff9c745177b37886
Reviewed-on: http://review.couchbase.org/39366
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-11537 use formula backfill_remaining + qlen to calculate tap backlog size

per advise from storage engine team
because total_backlog_size currently includes checkpoint_meta items thus
producing incorrect result

Change-Id: Ifdf522456b82b8e054be2b875b31d79908ef9639
Reviewed-on: http://review.couchbase.org/39247
Tested-by: Artem Stemkovski <artem@couchbase.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
return node version from prepare_rebalance call

Change-Id: Id99731e69291d13950c2f10006cc3efafd80b169
Reviewed-on: http://review.couchbase.org/39222
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
rewire inhibit and uninhibit compaction calls via janitor_agent

...to have one single frontend for remote calls

Change-Id: I8936cb8ff4713ec867151162cf8d6444ac961423
Reviewed-on: http://review.couchbase.org/39223
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
frontend for compaction daemon

... abstracts the compaction daemon api from the inner structure of
the compaction daemon which will eliminate the need of backwards compat
code for potential future changes in compaction daemon

Change-Id: I59499d3a0e531b5fe328990d8bfe4e5ee41f8682
Reviewed-on: http://review.couchbase.org/39246
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
drop unused define

Change-Id: I2d7b181021563c82cf8c12ccf6d243ed0f026284
Reviewed-on: http://review.couchbase.org/39272
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
re-factoring: abstract compaction scheduler code into separate module

Change-Id: I694a8c51996053d930b3e2c494ec9ba186029487
Reviewed-on: http://review.couchbase.org/39309
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>