[SERVER-2133] Uncaught exception: distinct failed Created: 22/Nov/10  Updated: 16/Jan/11  Resolved: 16/Jan/11

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 1.6.5
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Troy Davisson Assignee: Unassigned
Resolution: Duplicate Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

CentOS 5.4, 64-bit, Xen environment


Operating System: ALL
Participants:

 Description   

Using the 1.6.5-rc2- 2010-11-21 nightly build

I have a capped collection called "hits2" which is set with a size of 1GB (if it means anything, I'm running into the same thing with a different collection capped at 100MB). When using the mongo shell and running distinct() on a particular key of the documents, it works fine until the capped collection is full. Now, most of the time that this is executed, I get the following error message:

> db.hits2.distinct("userName")                      
Mon Nov 22 10:41:08 uncaught exception: distinct failed: {
	"errmsg" : "exception: assertion db/../bson/bsonelement.h:448",
	"code" : 0,
	"ok" : 0
}

I can sometimes get the distinct() command to return results and sometimes it will return a partial list before throwing the error mid-way through.



 Comments   
Comment by Eliot Horowitz (Inactive) [ 16/Jan/11 ]

Was fixed by: SERVER-1850

Comment by Lennart Koopmann [ 03/Dec/10 ]

(The collection I tried to distinct from was also capped)

Comment by Lennart Koopmann [ 03/Dec/10 ]

Same here. It was happening all the time while i was inserting a lot of data into the collection I tried to distinct from. I really inserted a lot of data there in a looping script that took all the CPU time it could get.

Fri Dec 3 02:07:09 [conn285] graylog2 Assertion failure 0 db/../bson/bsonelement.h 448
0x816363b 0x81717b3 0x810a0c6 0x811b909 0x810a507 0x841a01a 0x84063c4 0x840740c 0x823e3cc 0x8241cfd 0x835ef36 0x8367dcd 0x84a3de3 0x81ccbd8 0x84bd80d 0xfa3cc9 0xbc46ae
/usr/bin/mongod(_ZN5mongo12sayDbContextEPKc+0xcb) [0x816363b]
/usr/bin/mongod(_ZN5mongo8assertedEPKcS1_j+0x143) [0x81717b3]
/usr/bin/mongod(_ZNK5mongo11BSONElement9woCompareERKS0_b+0x256) [0x810a0c6]
/usr/bin/mongod(ZNSt8_Rb_treeIN5mongo11BSONElementES1_St9_IdentityIS1_ENS0_26BSONElementCmpWithoutFieldESaIS1_EE13insert_uniqueERKS1+0x49) [0x811b909]
/usr/bin/mongod(_ZNK5mongo7BSONObj15getFieldsDottedERKNS_10StringDataERSt3setINS_11BSONElementENS_26BSONElementCmpWithoutFieldESaIS5_EE+0xe7) [0x810a507]
/usr/bin/mongod(_ZN5mongo15DistinctCommand3runERKSsRNS_7BSONObjERSsRNS_14BSONObjBuilderEb+0x42a) [0x841a01a]
/usr/bin/mongod(_ZN5mongo11execCommandEPNS_7CommandERNS_6ClientEiPKcRNS_7BSONObjERNS_14BSONObjBuilderEb+0xac4) [0x84063c4]
/usr/bin/mongod(_ZN5mongo12_runCommandsEPKcRNS_7BSONObjERNS_10BufBuilderERNS_14BSONObjBuilderEbi+0x62c) [0x840740c]
/usr/bin/mongod(_ZN5mongo11runCommandsEPKcRNS_7BSONObjERNS_5CurOpERNS_10BufBuilderERNS_14BSONObjBuilderEbi+0x4c) [0x823e3cc]
/usr/bin/mongod(ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1+0x1b2d) [0x8241cfd]
/usr/bin/mongod() [0x835ef36]
/usr/bin/mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_8SockAddrE+0x16ed) [0x8367dcd]
/usr/bin/mongod(_ZN5mongo10connThreadEPNS_13MessagingPortE+0x313) [0x84a3de3]
/usr/bin/mongod(_ZN5boost6detail11thread_dataINS_3_bi6bind_tIvPFvPN5mongo13MessagingPortEENS2_5list1INS2_5valueIS6_EEEEEEE3runEv+0x18) [0x81ccbd8]
/usr/bin/mongod(thread_proxy+0x7d) [0x84bd80d]
/lib/libpthread.so.0(+0x5cc9) [0xfa3cc9]
/lib/libc.so.6(clone+0x5e) [0xbc46ae]

I was using v1.6.3 (a Debian stable)

Thanks,
Lennart

Comment by Troy Davisson [ 22/Nov/10 ]

If it helps, I'll also add that this appears to happen when a new object is added to the collection (or maybe when an old object is purged from the collection?) while the distinct() command is gathering results. If I stop the logging process which adds about 30 new documents/sec to this collection, the results are returned without any apparent issues.

Generated at Thu Feb 08 02:59:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.