Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Couchbase | Couchbase Server 2.0

Serious bug in view generation

3 replies [Last post]
  • Login or register to post comments
Thu, 02/02/2012 - 11:03
stefan
Offline
Joined: 02/01/2012
Groups: None

After adding two entries to the database with

set("SQEN3FX4WHOK", {"name":"Stefan","timeMS": 1328186190296,"type": "notification","msg":"{\"id\":25,\"type\":\"newMessage\",\"msg\":\"notification\"}"
})

and

set("1F1U153LL06XA", {"name":"Stefan","timeMS": 1328186190569,"type": "notification","msg":"{\"id\":26,\"type\":\"newMessage\",\"msg\":\"notification\"}"
})

(the quotes are wrong or misssing because I have copied the above together. "msg" is a JSON object represented by a string but that shouldn't matter) within about 300ms (note the timestamp in timsMS) with the Java client and calling the view

function(doc) {
if(doc.type == "notification")
emit(doc.name, doc.msg);
}

with

http://127.0.0.1:8092/default/_design/notifications/_view/mynotifications?key="Stefan"

I get this:

{"total_rows":15,"rows":[
{"id":"SQEN3FX4WHOK","key":"Stefan","value":"{\"id\":25,\"type\":\"newMessage\",\"msg\":\"notification\"}"},
{"id":"SQEN3FX4WHOK","key":"Stefan","value":"{\"id\":26,\"type\":\"newMessage\",\"msg\":\"notification\"}"}
]}

Note that both entries in "rows" have the same "id"!!!

Both entries can be queried correctly with get, it seems that just the index of the view is broken. Adding another item to the database which then is also emitted in the view doesn't fix it. After regenerating the view (by for example adding a space in the view code somewhere) all is fine again and the ids are different.

The bug is very easy to reproduce here.

I am using Couchbase 2.0 preview 3 on Mac OS Lion.

Stefan

Top
  • Login or register to post comments
Thu, 02/02/2012 - 12:28
twjordan
Offline
Joined: 01/29/2012
Groups:

Yes, I am seeing the same issue: www.couchbase.com/forums/thread/duplicates-returned-view-results

Top
  • Login or register to post comments
Fri, 03/02/2012 - 16:02
dipti
Offline
Joined: 11/02/2011
Groups:

Hi Stefan

Thanks for reporting this error. We are working on releasing Developer Preview 4 in a few days with several issues with views resolved and this issue should be fixed as well. I just tested this scenario on a recent build and see the correct behavior.

{"total_rows":10,"rows":[
{"id":"1F1U153LL06XA","key":"Stefan","value":{"id":26,"type":"newMessage","msg":"notification"}},
{"id":"SQEN3FX4WHOK","key":"Stefan","value":{"id":25,"type":"newMessage","msg":"notification"}}
]
}

Screenshot of the UI with view and query results: https://img.skitch.com/20120302-g2tebyigr38if2dnatarn7arc1.jpg

Top
  • Login or register to post comments
Thu, 03/22/2012 - 10:33
ingenthr
Offline
Joined: 03/16/2010
Groups:

Note that 2.0 DP4 was released this morning, so you should have a fix to this issue now. Please let us know if you still see problems.

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker