[SERVER-2746] Geo-indexing + Max fails when max is very large Created: 11/Mar/11 Updated: 12/Jul/16 Resolved: 15/Mar/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 1.8.0-rc2 |
| Fix Version/s: | 1.9.0 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Gaetan Voyer-Perrault | Assignee: | Greg Studer |
| Resolution: | Done | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Ubuntu and Windows |
||
| Participants: |
| Description |
|
To repro run the following commands against an empty db. > db.tri.ensureIndex( { c: '2d', t: 1 }, { min: 0, max: Math.pow(2, 40) }) ) , "v" : 0 } , "name" : "c__t_1", "min" : 0, "max" : 1099511627776 } So we're creating a Geo index with a very large max. It's obviously not too large as the index correctly saves / displays the number. However, when we insert data, that index throws the "point not in range" error. Math.pow(2,30) => works correctly (integer vs numberlong issue?) |
| Comments |
| Comment by Greg Studer [ 14/Mar/11 ] |
|
Updated to disallow index creation with very large/small bounds, higher-precision 2d indexing would be a new feature. |
| Comment by auto [ 14/Mar/11 ] |
|
Author: {u'login': u'gregstuder', u'name': u'gregs', u'email': u'greg@10gen.com'}Message: Changes for |
| Comment by auto [ 14/Mar/11 ] |
|
Author: {u'login': u'gregstuder', u'name': u'gregs', u'email': u'greg@10gen.com'}Message: New test for |
| Comment by Greg Studer [ 14/Mar/11 ] |
|
Thanks for the helpful test, you are correct, the issue is that the maximum precision in the 2d indexing is 32 bits, and therefore uses integers for max and min bounds. The index is actually not storing the large values correctly, they overflow, but the db.system.indexes collection stores the javascript data from the call itself. There should be a more helpful error message provided, however, as it is not at all obvious what's going on otherwise. |