[SERVER-2296] $OR queries with large numbers of attributes values cause memory allocation error and server shutdown Created: 28/Dec/10 Updated: 30/Mar/12 Resolved: 28/Dec/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 1.6.5 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Thomas DeMille | Assignee: | Aaron Staple |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows Server 2008 64 |
||
| Operating System: | Windows |
| Participants: |
| Description |
|
Running an $OR query with a large number of attributes queried, like the one below, cause a c++ error ' Uncaught std::exception: bad allocation, terminating'. I have seen this error with as few as 15 and as many as 300 queried $OR attributes. This is using the 10GEN c# driver to create the query. Below is the output from the mongod log. In some cases the last thing logged on the connection will be 'running multiple plans', but not in all cases. In the case below this is the exact output from the server with nothing filtered. Mon Dec 27 19:14:52 [conn1] run command BtSearchCache.$cmd { count: "Board_12", query: { g: { $lte: 200000 }, RN: { $ne: 1 }, CL: { $ne: 1 }, $or: [ { c: "2362" }, { c: "2343" }, { c: "2333" }, { c: "2388" }, { c: "2302" }, { c: "2353" }, { c: "1561" }, { c: "2312" }, { c: "2280" }, { c: "1438" }, { c: "2255" }, { c: "2254" }, { c: "1435" }, { c: "1407" }, { c: "2262" }, { c: "1356" }, { c: "2326" }, { c: "2278" }, { c: "2275" }, { c: "2351" }, { c: "2417" }, { c: "1484" }, { c: "2266" }, { c: "41397" }, { c: "2299" }, { c: "2334" }, { c: "1276" }, { c: "41396" }, { c: "2354" }, { c: "2235" }, { c: "2233" }, { c: "1363" }, { c: "2425" }, { c: "2376" }, { c: "2366" }, { c: "2258" }, { c: "1453" }, { c: "1475" }, { c: "2358" }, { c: "1434" }, { c: "1476" }, { c: "2345" }, { c: "1402" }, { c: "2405" }, { c: "2315" }, { c: "2323" }, { c: "2399" }, { c: "2301" }, { c: "1334" }, { c: "1416" }, { c: "2328" }, { c: "2270" }, { c: "2352" } ] } } |
| Comments |
| Comment by Aaron Staple [ 28/Dec/10 ] |
|
I think this is It looks like your query can be written using the $in operator to avoid this issue in 1.6. |