Remove unused tap connection validity functions.

Change-Id: I541419cb948d892717ff95bb539b1dda9d1281bf
Reviewed-on: http://review.couchbase.org/15347
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Reviewed-on: http://review.couchbase.org/15395
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>
MB-5092 Queue non-existent item deletion into checkpoints.

An item might not exist in the replica vbucket when its deletion
is received from the active vbucket, if that item was already
expired and deleted from the replica vbucket. In this case,
an item deletion should be still pushed into a checkpoint for
replication into another replica vbucket.

Change-Id: I2bd079c09ffcb0c7c54a4898ba7a497c279f74c6
Reviewed-on: http://review.couchbase.org/15348
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Reviewed-on: http://review.couchbase.org/15396
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Release the lock after releasing the dead TAP connections.

Change-Id: Ifd86dcc7a58a4f34ba223d9cb166a275ab92d0ce
Reviewed-on: http://review.couchbase.org/15360
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Reviewed-on: http://review.couchbase.org/15397
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Add an extra reference to the tap connection during notifications

This change is used to try to determine where the race condition
problem occurs.

Change-Id: I93ad82715e8b334a3c883dc59525dadaaaeb1cac
Reviewed-on: http://review.couchbase.org/15349
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Reviewed-on: http://review.couchbase.org/15398
Remove unnecessary TAP notify calls.

Change-Id: Idadfc3eaac92f124832840fcffb6206b63d393bc
Reviewed-on: http://review.couchbase.org/15363
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Reviewed-on: http://review.couchbase.org/15399
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
MB-5092 Don't drop items from dead vbucket checkpoints.

With the new swap rebalance algorithm, there is a very small time
window between (1) the active vbucket becomes a dead state after
takeover, and (2) then reset to replica state. This change doesn't
drop items from dead vbuckets for more reliable replication with
the new rebalance algorithm.

Change-Id: Ieb8a97314a6f567c5c2ae5c853db6b1271f8b971
Reviewed-on: http://review.couchbase.org/15364
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Reviewed-on: http://review.couchbase.org/15400
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Queue non-existent replica item deletion into checkpoints

We shouldn't push non-existence active item deletion into
checkpoints. This change resolves the issue from the
previous commit ee319a9093bb766a05294b78a2b45e9584fb1ac6.

Change-Id: I78ea5a4df58a1117e5a494cdbcfcb251d2b434e8
Reviewed-on: http://review.couchbase.org/15369
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Reviewed-on: http://review.couchbase.org/15401
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Merge branch 'branch-18'

* branch-18:
  Queue non-existent replica item deletion into checkpoints
  MB-5092 Don't drop items from dead vbucket checkpoints.
  Remove unnecessary TAP notify calls.
  Add an extra reference to the tap connection during notifications
  Release the lock after releasing the dead TAP connections.
  MB-5092 Queue non-existent item deletion into checkpoints.
  Remove unused tap connection validity functions.

Change-Id: Iac4a7d86e0dde4776b4a3e6c3590d0cfd18877ec