MB-15946: Set correct threshold for adding new replica checkpoint on snap end
MB-15946: Set correct threshold for adding new replica checkpoint on snap end

We want to create a new replica checkpoint (hence close and release the
memory consumed by the current replica checkpoint) before we reach a
condition where we cannot set new items from the front end load on the node.
Currently the threshold for front end load is 93%. This change sets the
threshold to add new replica checkpoint upon receiving snapshot end to
high watermark (85%).

Note, this however does not completely rule out the deadlock scenario
on buckets with very small mem quota and large item size. This change
is simple and reduces the possibility of deadlock.

To completely remove the deadlock possibility we should close all (or most
until memory usage goes below some limit) replica checkpoints which have
received last item in the snaphot. This is likely to be addressed in
another change.

Change-Id: I80a914186fbaae71f45b20f68547261715a09dc8
Reviewed-on: http://review.couchbase.org/59222
Reviewed-by: Chiyoung Seo <fcffc23db27b19ee4ebba46695ee6b50e09216a2@couchbase.com>
Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>

teligent-ru/ep-engine,teligent-ru/ep-engine,daverigby/kv_engine,membase/ep-engine,owendCB/ep-engine,hisundar/ep-engine,teligent-ru/ep-engine,daverigby/kv_engine,daverigby/kv_engine,daverigby/ep-engine,owendCB/ep-engine,daverigby/ep-engine,owendCB/ep-engine,couchbase/ep-engine,daverigby/kv_engine,hisundar/ep-engine,owendCB/ep-engine,daverigby/ep-engine,hisundar/ep-engine,daverigby/ep-engine,couchbase/ep-engine,couchbase/ep-engine,membase/ep-engine,hisundar/ep-engine,membase/ep-engine,teligent-ru/ep-engine,couchbase/ep-engine,membase/ep-engine