MB-7471: Fix race condition in persistence checkpoint test

Thread 1 and 2 would issue a persist checkpoint command, both of
which are expected to time out. Thread 1's command would finish and
bump the timeout up and then go on to load items and call the
checkpoint persistence command again. This persistenc command would
finish and lower the time out value back to the default value. Thread
2's first checkpoint persistence command now finishes, but when we
check to see if the timeout was bumped up we fail the test.

We should just be checking that checkpoint persistence happens after
we join the threads in order to fix this problem.

Change-Id: Ie4b34e647684c2760a620e4c2aa40c3ea724caff
Reviewed-on: http://review.couchbase.org/23756
Reviewed-by: Jin Lim <jin@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-7500: Add averages to cbstats histograms

Below is an example of the what the new timing stats
will look like. Note the new "Avg" field.

rw:fsWriteTime (522402 total)
   2us - 4us     : ( 15.75%)  82276 ##############
   4us - 8us     : ( 47.23%) 164469 #############################
   8us - 16us    : ( 62.28%)  78614 ############
   16us - 32us   : ( 80.93%)  97422 ################
   32us - 64us   : ( 88.40%)  38999 #####
   64us - 128us  : ( 91.92%)  18389 ##
   128us - 256us : ( 94.04%)  11077 #
   256us - 512us : ( 99.70%)  29589 ####
   512us - 1ms   : ( 99.93%)   1178
   1ms - 2ms     : ( 99.98%)    276
   2ms - 4ms     : ( 99.99%)     40
   4ms - 8ms     : ( 99.99%)     14
   8ms - 16ms    : ( 99.99%)     30
   16ms - 32ms   : (100.00%)     25
   32ms - 65ms   : (100.00%)      2
   65ms - 131ms  : (100.00%)      1
   131ms - 262ms : (100.00%)      1
   Avg           : (   31us)

Change-Id: Ic3ec69fbac450dd49a4411208e6f634c839364e0
Reviewed-on: http://review.couchbase.org/23757
Reviewed-by: Jin Lim <jin@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-7498: Change high and low watermarks to 85 and 75 respectively

Change-Id: Ie37b79f979b7b7c713ce5a4d8785b2e94245aa33
Reviewed-on: http://review.couchbase.org/23794
Reviewed-by: Jin Lim <jin@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-7459 should count expired items during warmup

For better account of expired items, numExpiredItems must
also count any item that has expired (and deleted) during
the data loading phase of warmup.

Unit test case that requires memcached test api will be
merged with a separate patch

Change-Id: Ia1b8cce6daf29c5bca83179c63bfeb1e3e7c2be0
Reviewed-on: http://review.couchbase.org/23934
Tested-by: Jin Lim <jin@couchbase.com>
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
MB-7532 Set the default value of a rev sequence num to 1.

As the XDCR always expects a positive value for a revision
sequence number, its default value should be initialized to 1.

Change-Id: I7a281ad55d9c5d7e4ed93a6d4e33c609606f7f29
Reviewed-on: http://review.couchbase.org/23964
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Reviewed-by: Jin Lim <jin@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Reviewed-on: http://review.couchbase.org/24002
MB-7543 Rev sequence number shouldn't be set to zero.

We should make sure that the revision sequence number shouldn't
be zero during warmup or when we receive tap_deletion,
tap_mutation, set_with_meta, and delete_with_meta.

Change-Id: I3316e0b688e2f29efc94533fab6fe61df0ea871a
Reviewed-on: http://review.couchbase.org/24004
Reviewed-by: Jin Lim <jin@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Merge remote-tracking branch 'gerrit/2.0.0' into 2.0.1

Change-Id: Ifef980916191adc0b7bc60e9d50bf201e051add6
MB-7597: correct the logic of updating bgfetcher global variable

Change-Id: Ib2f460e04ec7bf0cf2c4e06b45774f9f2dd4d91c
Reviewed-on: http://review.couchbase.org/24553
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-7597: adjust the changes for high CPU usage.

Change-Id: Ib5c55a13ad5c99d6c920c9617f67de1899a5474f
Reviewed-on: http://review.couchbase.org/24565
Tested-by: xiaoqin ma <maxiaoqin2005@gmail.com>
Reviewed-by: Jin Lim <jin@couchbase.com>
Use couchstore file API v4

Change-Id: I55c1ee959079abc5a23b517531b9cf9f9ea10d07