[SERVER-4316] Assertion db/query.cpp 727 Created: 18/Nov/11  Updated: 11/Jul/16  Resolved: 18/Nov/11

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 1.8.0-rc0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Nguyen Minh Hai Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux version 2.6.18-194.11.1.el5xen (mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48))

processor : 0,1,2
vendor_id : GenuineIntel
cpu family : 6
model : 44
model name : Intel(R) Xeon(R) CPU X5650 @ 2.67GHz
stepping : 2
cpu MHz : 2659.998
cache size : 12288 KB

MemTotal: 3145728 kB


Operating System: Linux
Participants:

 Description   

[Status]

db.queue.findOne()
{
"_id" : ObjectId("4e9a90d9de142a0c5b392XYZ"),
"_u" : "xxx-yyy-zzz",
"status" : 1,
"update_time" : 1318752472
}

"status" value can be 0, 1, 2

db.queue.stats()
{
"ns" : "test.queue",
"count" : 153794,
"size" : 22760436,
"avgObjSize" : 147.99300362822996,
"storageSize" : 33327616,
"numExtents" : 8,
"nindexes" : 3,
"lastExtentSize" : 12079360,
"paddingFactor" : 1,
"flags" : 1,
"totalIndexSize" : 26050560,
"indexSizes" :

{ "_id_" : 6406144, "_u_1" : 14622720, "update_time_1" : 5021696 }

,
"ok" : 1
}

[Issues]

When executing the find() command with 2 conditions like belowing

db.queue.find({"_id":{$gt:ObjectId("000000000000000000000000")}, "status":{$gt:2}})

The following error message has occurred,

>> error:

{ "$err" : "assertion db/query.cpp:727" }

However, when the filtering value for the second condition is in the range of "status" [0,1,2],
like this, "status":{$gt:0}, it runs well.

Notice that, "status" is not indexed and has only three integer value of 0, 1 or 2.
Moreover, the number of document needs to be large enough, in my case it is about 153794 documents.

[Detail]

For your information, I think the problem lies in shared pointer _c in db/query.cpp.

OK
db.queue.find({"_id":{$gt:ObjectId("000000000000000000000000")}, "status":{$gt:0}})
db.queue.find({"_id":{$gt:ObjectId("000000000000000000000000")}, "status":{$gt:1}})

>> error:

{ "$err" : "assertion db/query.cpp:727" }

db.queue.find({"_id":{$gt:ObjectId("000000000000000000000000")}, "status":{$gt:2}})
db.queue.find({"_id":{$gt:ObjectId("000000000000000000000000")}, "status":{$gt:3}})

OK
db.queue.find({"_id":{$gt:ObjectId("000000000000000000000000")}, "status":{$lt:2}})

>> error:

{ "$err" : "assertion db/query.cpp:727" }

db.queue.find({"_id":{$gt:ObjectId("000000000000000000000000")}, "status":{$lt:0}})
db.queue.find({"_id":{$gt:ObjectId("000000000000000000000000")}, "status":{$lt:1}})



 Comments   
Comment by Nguyen Minh Hai [ 18/Nov/11 ]

Thanks Eliot!

We will upgrade to 2.0.1 as soon as possible.

Comment by Eliot Horowitz (Inactive) [ 18/Nov/11 ]

this was fixed quite a while ago.

you should definitely not be using 1.8.0-rc0 as it was a pre release of 1.8.0.

You should upgrade to 1.8.4 or 2.0.1

Generated at Thu Feb 08 03:05:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.