MB-11553 Adjust the checkpoint creation interval.

This change reduces the checkpoint creation interval to
mitigate the memory overhead caused by having blob instances
inside the open checkpoint. If a checkpoint creation interval
is large, it can cause significant memory overhead due to blob
instances inside the current open checkpoint.

Note that we also limit the number of checkpoints in memory, so
this change won't allow us to keep creating a new checkpoint if
the limit is reached.

Change-Id: I33119ef8b539d5f0209b64bcfcfcbd82632ae7e1
Reviewed-on: http://review.couchbase.org/39333
Reviewed-by: Sundararaman Sridharan <sundar@couchbase.com>
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung@couchbase.com>
MB-11661 Don't check the checkpoint manager upon ejecting an item

As a checkpoint has blob instances inside, we don't need to check
the checkpoint manager to see if we can eject an item from the
hash table.

Change-Id: I57fc887dc80b88ba275bc50ef7b7f8a5ff45e8c7
Reviewed-on: http://review.couchbase.org/39334
Reviewed-by: abhinav dangeti <abhinav@couchbase.com>
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung@couchbase.com>
MB-11661 Remove unreferenced closed checkpoints by item pager.

This change allows the item pager to remove unreferenced closed
checkpoints, so that it can free some memory before attempting to
eject items from the vbucket hash table. In this way, we can
avoid ejecting innocent (frequently accessed) items from hashtable.

Change-Id: I1ec971ce6de348f4320679f18d844c3ac548345d
Reviewed-on: http://review.couchbase.org/39335
Reviewed-by: abhinav dangeti <abhinav@couchbase.com>
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung@couchbase.com>
MB-11661 Move cursor to the next checkpoint if reached to the end

If a cursor is already reached to the end of its current
checkpoint, then the cursor can be moved to the next checkpoint.
In this way, a checkpoint can be immediately freed from memory
if the checkpoint doesn't have any cursors.

Change-Id: I378d0e2527610d7ad7773ebd35e3814d31bb7777
Reviewed-on: http://review.couchbase.org/39339
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung@couchbase.com>
MB-11661 Disable checkpoint merge support by default.

Merging closed checkpoints in a replica vbucket was mainly
supported to reduce the memory overhead in the replica vbucket,
which performs the replication to another replica vbucket.
For example, in the replication chain A->B->C, merging closed
checkpoints can be performed on the replica B if the replica C
is overloaded and constantly backs off the replication from the
replica B.

As of 3.0, we switch to the star replication, which doesn't
require supporting checkpoint merge operation. Thus, this change
disables the checkpoint merge operation by default, but still
allows us to enable / disable it dynamically at runtime.

Change-Id: I46b17030f35a5dad9575a6ecd2fde33f70b497bc
Reviewed-on: http://review.couchbase.org/39342
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung@couchbase.com>