[SERVER-2269] Map/reduce with sorting fail Created: 22/Dec/10 Updated: 22/May/12 Resolved: 26/Dec/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Build |
| Affects Version/s: | 1.6.5 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Andrey Nikishaev | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Ubuntu 10.10 2.6.35-23-generic #41-Ubuntu SMP Wed Nov 24 11:55:36 UTC 2010 x86_64 GNU/Linux |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Major Change | ||||||||
| Operating System: | Linux | ||||||||
| Participants: | |||||||||
| Description |
|
When i trying to make sort on map/reduce it fails with "db assertion failure" m = Code("""function() { ; emit(this.data, res); return data res = self.db.tasks.map_reduce(m,r,query= {'job_id':job_id},sort= {'position':pymongo.ASCENDING}) But when i turn off sorting it works pretty fine. |
| Comments |
| Comment by Eliot Horowitz (Inactive) [ 26/Dec/10 ] |
|
You need an index on job_id,position in order to use that. |
| Comment by Andrey Nikishaev [ 22/Dec/10 ] |
|
Server version: Tried 1.4.4, 1.6.5, 1.7.4 Python traceback: Traceback (most recent call last): ,query= {'job_id':ObjectId(job_id)}) ), ('query', {'job_id': ObjectId('4d121ac2ccab997705050000')}), ('reduce', Code('function(k,values) \n\t return data\n\t}', {})), ('map', Code("function() {\n\t data = {};\n\t res = ''\n\t if(this.result_id) {\n\t ;\n\t } else {\n\t res=this.result;\n\t }\n\t\tres['position'] = this.position;\n\t Mongo log: Wed Dec 22 17:36:56 [conn144] CMD: drop order: { position: 1 } choices: { In attachment file that reproduce problem. On version 1.4.4 i also notified that if sort param pass before query param res = self.db.tasks.map_reduce(m,r,sort= {'position':pymongo.ASCENDING}, ) instead: res = ,sort= {'position':pymongo.ASCENDING}) Best regards, Andrey Nikishaev Blog http://creotiv.in.ua/ 2010/12/22 Eliot Horowitz (JIRA) <jira@mongodb.org> |
| Comment by Eliot Horowitz (Inactive) [ 22/Dec/10 ] |
|
Can you send:
|