Couchbase view returns duplicate document


#1

I have a simple “account” document with the following view:

function (doc, meta) {
if ( doc.entityType === ‘account’ && doc.status != “DELETED” ) {
emit(meta.id, null);
}
}

Sometimes, (quite often), after adding an entry I get duplicate entries when query the db using that view. These entries are identical including their meta data.

Once the view retrieve a duplicate entry it will always return it as duplicate (the issues is consistently).

When checking the entries in the bucket I can see only one entry of this id thus the duplication is only in the view.

Once I create another view or delete and recreate this view, all duplicated entries are gone.

I’m using Couchbase 3.0.0 Enterprise Edition (build-1118)


View Return Duplicate Result
#2

Do any of these documents have an expiration, or are you only doing the logical deletion I can infer from the function?


#3

Ahah! Looks like we have the exact same problem mate! (see here) I hope someone will find a way to fix that issue, it’s really annoying. For what it’s worth, I’ve tried to disable compaction on my test bucket and it seems to prevent the issue to happen.


#4

Hm, interesting. Any chance either of you can describe how we can try to recreate the problem? Then I can get some folks to look at it.


#5

You could read my post, I described the way you can recreate the problem.


#6

It sounds like issue MB-13160. Can you try if disabling the bucket compaction makes a difference?


#7

Ah, sorry. I had read it and replied, but I’ll look more carefully and if I have any questions will let you know.


#8

Indeed, I created that issue. Guys, are you even reading posts?


#9

Yes, I pointed out to @vmx that you’d created it. We’re definitely reading them and we’re tripping over ourselves to reply. We’ll take a step back and have a look at it.


#10

Further discussions go on at MB-13160. It would be cool if you could provide more details about your load and also the update rates of documents. Your credentials should also work for JIRA, if they don’t feel free to post here.