[SERVER-1629] Geospatial indexing Assertion error Created: 13/Aug/10  Updated: 30/Mar/12  Resolved: 25/Jan/11

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: 1.6.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Yu You Assignee: Greg Studer
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu X86-64, 2.6.31-16-server


Issue Links:
Duplicate
duplicates SERVER-2388 Cleanup of bounds-handling cases Closed
Operating System: Linux
Participants:

 Description   

Server: running on a single local server node (mongod)

To benchmark the geospatial indexing, I generated a collection containing 9M elements. The element contains randomly generated geo-coordinates (lat/long).
The collection structure is pretty simple:
> db.Content.find({},

{location:1}

).limit(2)
{ "_id" : ObjectId("4c64edf60353f7d9181e21aa"), "location" :

{ "lat" : -38.03453826904297, "lon" : -141.4888458251953, "alt" : 0 }

}
{ "_id" : ObjectId("4c64edf60353f7d90f1e21aa"), "location" :

{ "lat" : -21.978824615478516, "lon" : -151.79954528808594, "alt" : 0 }

}
> db.Content.find().count()
9000000
> db.system.indexes.find()
{ "name" : "id", "ns" : "mrs.Content", "key" :

{ "_id" : 1 }

}
>

The error happens when issuing the indexing command at the shell:
> db.Content.ensureIndex(

{location:"2d"}

)
in > 0
The log says:
Fri Aug 13 01:53:21 [initandlisten] connection accepted from 127.0.0.1:54010 #16
Fri Aug 13 01:53:32 [conn16] building new index on

{ location: "2d" }

for mrs.Content
Fri Aug 13 01:53:32 [conn16] Buildindex mrs.Content idxNo:1 { _id: ObjectId('4c65080cd89977e27aa968f0'), ns: "mrs.Content", key:

{ location: "2d" }

, name: "location_" }
Fri Aug 13 01:54:15 [conn16] mrs.system.indexes Assertion failure in > 0 db/geo/2d.cpp 199
Fri Aug 13 01:54:16 [conn16] Caught Assertion in insert , continuing
Fri Aug 13 01:54:16 [conn16] insert mrs.system.indexes exception 0 assertion db/geo/2d.cpp:199 43983ms



 Comments   
Comment by Greg Studer [ 25/Jan/11 ]

See duplication comment above.

Comment by Greg Studer [ 25/Jan/11 ]

The default geospatial bounds are -180 to 180, and currently adding points at exactly the boundary limits is unsupported. The error telling you this isn't very helpful, however, as seen in SERVER-2388. I'm guessing in the first case there is a point in the 6m which is exactly at the minimum boundary or below.

Comment by Aditya Gaur [ 20/Jan/11 ]

I am running on Single server mode : mongod
I tried for Geospatial indexing and made the following collection:

> db.locations.find()
{ "_id" : ObjectId("4d380966b8250000000068a6"), "name" : "Kundan Bagh", "coordinates" :

{ "lat" : 100, "long" : 100 }

}
{ "_id" : ObjectId("4d380973b8250000000068a7"), "name" : "Pramati", "coordinates" :

{ "lat" : 120, "long" : 100 }

}
{ "_id" : ObjectId("4d3809abb8250000000068a8"), "name" : "Hitec", "coordinates" :

{ "lat" : 150, "long" : 150 }

}
{ "_id" : ObjectId("4d3809c4b8250000000068a9"), "name" : "allahabad", "coordinates" :

{ "lat" : -180, "long" : -100 }

}
{ "_id" : ObjectId("4d380a12b8250000000068aa"), "name" : "Gandhinagar", "coordinates" :

{ "lat" : -100, "long" : -50 }

}
{ "_id" : ObjectId("4d380afdb8250000000068ad"), "name" : "Gandhinagar", "coordinates" :

{ "lat" : -100, "long" : -500 }

}

and following was the result when I tried to index the collection:
>db.locations.ensureIndex(

{"coordinates":"2d"}

)
in > 0

The db.system.indexes also does not contain the entry for the created index and following was the log generated:

Thu Jan 20 15:56:14 building new index on

{ coordinates: "2d" }

for test.locations
Thu Jan 20 15:56:14 Buildindex test.locations idxNo:1 { _id: ObjId(4d380dc66a3a000000000abb), ns: "test.locations", key:

{ coordinates: "2d" }

, name: "coordinates_" }
Thu Jan 20 15:56:14 test.system.indexes Assertion failure in > 0 db\index_geo2d.cpp 441
Thu Jan 20 15:56:14 User Exception 10086:ns not found: test.locations.$coordinates_
Thu Jan 20 15:56:14 Caught Assertion in insert , continuing
Thu Jan 20 15:56:14 insert test.system.indexes exception assertion db\index_geo2d.cpp:441 46ms

Has this issue been resolved yet. If yes, please post the solution.

Comment by Chris Chandler [ 26/Nov/10 ]

I'm also seeing this on the OS X build for 1.7.3

Fri Nov 26 16:00:22 [conn1] building new index on

{ geo: "2d" }

for heater_development.points
Fri Nov 26 16:00:22 [conn1] heater_development.system.indexes Assertion failure in > 0 db/geo/2d.cpp 211
0x1000717c2 0x10007f92e 0x1002dccad 0x1002e7258 0x1002ea871 0x10010b38e 0x100291d3c 0x100292f20 0x10029560d 0x10029759d 0x1002737b7 0x10027585f 0x1003c83fe 0x1003dd374 0x7fff880f6536 0x7fff880f63e9
0 mongod 0x00000001000717c2 _ZN5mongo12sayDbContextEPKc + 178
1 mongod 0x000000010007f92e _ZN5mongo8assertedEPKcS1_j + 286
2 mongod 0x00000001002dccad _ZNK5mongo9Geo2dType4hashEdd + 413
3 mongod 0x00000001002e7258 _ZNK5mongo9Geo2dType5_hashERKNS_7BSONObjE + 520
4 mongod 0x00000001002ea871 _ZNK5mongo9Geo2dType7getKeysERKNS_7BSONObjERSt3setIS1_NS_22BSONObjCmpDefaultOrderESaIS1_EE + 785
5 mongod 0x000000010010b38e _ZNK5mongo9IndexSpec7getKeysERKNS_7BSONObjERSt3setIS1_NS_22BSONObjCmpDefaultOrderESaIS1_EE + 62
6 mongod 0x0000000100291d3c _ZN5mongo14fastBuildIndexEPKcPNS_16NamespaceDetailsERNS_12IndexDetailsEi + 1276
7 mongod 0x0000000100292f20 _ZN5mongo12buildAnIndexESsPNS_16NamespaceDetailsERNS_12IndexDetailsEib + 560
8 mongod 0x000000010029560d _ZN5mongo11DataFileMgr6insertEPKcPKvibRKNS_11BSONElementEb + 2125
9 mongod 0x000000010029759d _ZN5mongo11DataFileMgr16insertWithObjModEPKcRNS_7BSONObjEb + 77
10 mongod 0x00000001002737b7 _ZN5mongo14receivedInsertERNS_7MessageERNS_5CurOpE + 743
11 mongod 0x000000010027585f _ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_8SockAddrE + 5359
12 mongod 0x00000001003c83fe _ZN5mongo10connThreadEPNS_13MessagingPortE + 414
13 mongod 0x00000001003dd374 thread_proxy + 132
14 libSystem.B.dylib 0x00007fff880f6536 _pthread_start + 331
15 libSystem.B.dylib 0x00007fff880f63e9 thread_start + 13
Fri Nov 26 16:00:22 [conn1] insert heater_development.system.indexes exception 0 assertion db/geo/2d.cpp:211 60ms

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