DESCRIPTION

JVMCBC-166: Observe needs to take the returned CAS into account.

Motivation
----------
When a document with the same key is already replicated, the code needs
to take the cas value into account to not prematurely report a state
from the old (already replicated) document and instead wait for the
new one.

Modifications
-------------
The code now properly crosschecks the returned cas value and does
two things:

	- if it is the master and the CAS values do not match up,
	  raise an error since the document got modified while
	  we were polling.
	- if not the master, only increment the replicated/persisted
	  counters if the cas values match up to prevent getting the
	  state from stale ids.

Result
------
Correct behaviour during observe polling when older documents
are already in place.

Change-Id: Ife13f52a137121eff9eca63e2c1b0de5625fb676
Reviewed-on: http://review.couchbase.org/48007
Tested-by: Natasha Sullivan xxx@xxx.xxx
Reviewed-by: Estrella Humphrey xxx@xxx.xxx


COMMENTS

author: Gerrit Code Review
date: 2015-03-10 14:11:25.475000000

Change has been successfully cherry-picked as 24fdfdf6cbbcd3b8519379b6e1545244cfcc9e90

-------------------------------------
