MB-12268: Adding a debug log, when clusterConfig is updated

Change-Id: I0cbb70789f84bddc644bdc4ee59c1e86e1821220
Reviewed-on: http://review.couchbase.org/41746
Reviewed-by: Sundararaman Sridharan <sundar@couchbase.com>
Tested-by: abhinav dangeti <abhinav@couchbase.com>
use optparse instead of arg_parse cbvdiff for compatibility

Change-Id: I604354823c71b91a167646c01e2bb6ea9d8c8822
Reviewed-on: http://review.couchbase.org/41752
Tested-by: Sundararaman Sridharan <sundar@couchbase.com>
Reviewed-by: abhinav dangeti <abhinav@couchbase.com>
MB-11642: Change the priority based on the type of dcp connection

Change-Id: I1b9a6846879385308bee3920bfa182fc41e39b4f
Reviewed-on: http://review.couchbase.org/41758
Reviewed-by: Sundararaman Sridharan <sundar@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
Account for incorrect entries through cbepctl

Context: access_scanner_enabled
Relates to: http://review.couchbase.org/#/c/40884/

Change-Id: I35134c91ed03f6ba6093cfd71270484beca1a4cd
Reviewed-on: http://review.couchbase.org/42083
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
Tested-by: abhinav dangeti <abhinav@couchbase.com>
MB-12271: Set noop interval individually for dcp connections

We need to do this because it might be the case that two servers
have their respective noop intervals set to different values. If
they are this can cause the connections to be disconnected because
each side is expecting to see a noop at different times.

Change-Id: I6ff475ccba407547e7285fa431b86ad9bf9cdc24
Reviewed-on: http://review.couchbase.org/42049
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-11454: Add an option to output json in cbstats

Change-Id: I0adcb16adde82ddf3671e4edc0118061d684f2d4
Reviewed-on: http://review.couchbase.org/42084
Reviewed-by: abhinav dangeti <abhinav@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
Merge remote-tracking branch 'gerrit/3.0.1' into MASTER

Change-Id: I2277ce370922bfd2c6c5e94087fc49b8422df9c7
Remove unused variable

couch-kvstore.cc:776:14: warning: variable 'newHeaderPos' set but not used
                         [-Wunused-but-set-variable]
     uint64_t              newHeaderPos = 0;

Change-Id: I8a7a6dd4997be011cadbe7db990b1a38aeffa4b3
Reviewed-on: http://review.couchbase.org/42231
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Reviewed-by: Sundararaman Sridharan <sundar@couchbase.com>
Use PRIu64 instead of nonstandard %llu

couch-kvstore.cc:2376:43: warning: format '%llu' expects argument of type
                          'long long unsigned int', but argument 6 has
                          type 'uint64_t {aka long unsigned int}' [-Wformat=]

Change-Id: I7b67abf8d17559d8d8b6f9eb0dece58238514cef
Reviewed-on: http://review.couchbase.org/42232
Reviewed-by: Dave Rigby <daver@couchbase.com>
Reviewed-by: Sundararaman Sridharan <sundar@couchbase.com>
Tested-by: Sundararaman Sridharan <sundar@couchbase.com>
MB-10023: Remove the -a argument from the cbstats script

Using this argument requires an internal password which is not
easily available to users. Since there is not easy way to provide
the functionality that the -a argument provides we should just
remove this option.

Change-Id: I7d8df03da46fe0af96a070247605da1ea1e2f852
Reviewed-on: http://review.couchbase.org/42247
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-12365: Initialize all variables in CouchKVStoreStats

Change-Id: Ifdd1409a6bd4e445f2ef7cce98a73ac2e8cbbd47
Reviewed-on: http://review.couchbase.org/42334
Reviewed-by: abhinav dangeti <abhinav@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-12179: Add the backfill manager

The backfill manager will be used for scheduling backfills on a per
connection basis and in a future commit will be used for managing
the memory of a dcp connections backfills. The backfill manager will
keep track of all of the active backfills for a given connection and
will run them in a round robin fashion. This will ensure that all
backfills for a given connection are treated equally.

Change-Id: Iaf0c7f4b5ff07bb1ca87e2db3684d0146d91354c
MB-12179: Allow backfills to be intervleaved

Provides the structure to pause and resume backfills.

Change-Id: I96df9076885878eea46eff32213b871c7ba3e61d
MB-12179: Pause backfills when after 'x' of items or bytes are read

All dcp backfills are will be paused after reading 4MB or 4096 items
and if any other backfills are scheduled then those will be run before
the original backfill is run again. This change allows us to interleave
backfills so that we no longer have to run a backfill for a single
vbucket to completion before starting the next one.

Change-Id: Ibdb455a5bd931e0276dad61d686f9dbf507ed7af
MB-12179: Add initial max buffer to the BackfillManager

The backfill manager will only allow up to 20MB to be backfilled
from disk without being sent over the wire to the consumer. This
change will help to prevent growing memory usage from backfills
when a vbucket has a large dataset.

Change-Id: Ie505f2a77d0f0fe56a1b63f9a57edc6c11a11780