Fix to setting incorrect rev_seqno in hashtable::add()

If an item in hashtable has a state of temp_deleted_key, which
means that the item is marked as "deleted" in a storage layer,
we should set its rev_seqno to its current rev_seqno + 1
when that item is added back to the hashtable.

Change-Id: I9671a7826b9d9302d04d86f84cf1a8e502a5e912
Reviewed-on: http://review.couchbase.org/33167
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung@couchbase.com>
Fix to the sporadic failures on test_item_pager unit test

We just need to wait until the memory usage drops below high
watermark, to see if frequently referenced items are evicted or
not.

Change-Id: Ic766730403bf40b0478778bf53b8f5cf0b581154
Reviewed-on: http://review.couchbase.org/33194
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung@couchbase.com>
Reschedule the vbucket bg fetch task if its DB file is not created

We might receive getMeta requests for non-existent keys before
their vbucket DB file is created. Therefore, it is required to
reschedule a bg fetch job until the file is created.

Change-Id: I4c692526fceea3b0015728ec40d9d815bc58ff6b
Reviewed-on: http://review.couchbase.org/33221
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung@couchbase.com>
Track the number of items per vbucket with the full eviction.

As the full eviction ejects an item from cache completely, we
need a new way of tracking the number of item per vbucket when
the full eviction is chosen.

This change basically adds a new flag to the hash table item
(i.e., StoredValue) to indicate whether an item is newly added
to the cache or not, and then increments the item counter. Then,
the flusher figures out whether the counter should be decremented
because the item already exists on the DB file.

Change-Id: I492c03053238a4baa155eb76575893da323d26c4
Reviewed-on: http://review.couchbase.org/32985
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung@couchbase.com>
Reset VB creation flag only for vbuckets whose states are changed

Change-Id: Idf128288fe8b1413d9218f0778bd48cfb044d98f
Reviewed-on: http://review.couchbase.org/33234
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung@couchbase.com>
Adapt the flusher's persistence function for UPR.

As the UPR requires a strict consistency in persisting dirty
items with respect to their by-seq numbers, the flusher should
not look up the hash table to persist the latest value for each
dirty item.

Change-Id: I83f8cca4e44cfdd6dc8da38daaa8dfc838a444bb
Reviewed-on: http://review.couchbase.org/33064
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung@couchbase.com>
Make sure upr mutation/deletion messages by_seqno's increase

Change-Id: I6837d68fdfc798c5e4203080f271c62137acaaf4
MB-9694: Fix crash caused by creating two same named upr conns

When we have an upr connection with a given name and another upr
connection is made with the same name then we need to close the
first connection and allow the second one to be created.

Change-Id: I0346b70f395b3d8c29f5288ffc7ecd5cc36a7700
Add stream end to list of expected ack messages

Change-Id: Ibf20b96e24dd52c7bacb96c17828c3db80b5f5e5