Skip to content

Commit

Permalink
When a key is mutated change the deleted field to false
Browse files Browse the repository at this point in the history
We want to do this because we only want to show that a key
is in the deleted state if it doesn't exist in Couchbase.
Lets say a key is being watched for multiple cas values
and then that key gets deleted. We will record deleted
on all of that key's observed cas values. If a user later
sets a key in the database with the same key name then the
deleted state will be cleared and replaced with mutated.

Change-Id: I53337ba355d7196a6f7234b9990125e761af51eb
Reviewed-on: http://review.couchbase.org/10374
Reviewed-by: Steve Yen <steve.yen@gmail.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
  • Loading branch information
Mike Wiederhold authored and Michael Wiederhold committed Oct 27, 2011
1 parent def26a3 commit f762647
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions observe_registry.cc
Expand Up @@ -325,6 +325,7 @@ void VBObserveSet::keyEvent(const std::string &key, const uint64_t cas,
} else if (itr->key.compare(key) == 0 && itr->cas != cas &&
event == OBS_MODIFIED_EVENT) {
itr->mutated = true;
itr->deleted = false;
} else if (itr->key.compare(key) == 0 && itr->cas == cas) {
if (event == OBS_PERSISTED_EVENT) {
itr->persisted = true;
Expand Down

0 comments on commit f762647

Please sign in to comment.