[SERVER-17889] Using eval command to run mapReduce with non-inline "out" option triggers fatal assertion failure Created: 05/Apr/15 Updated: 19/Sep/15 Resolved: 08/Apr/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | MapReduce |
| Affects Version/s: | 3.0.1 |
| Fix Version/s: | 3.0.3, 3.1.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Roman [X] | Assignee: | J Rassi |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Minor Change | ||||||||||||
| Operating System: | ALL | ||||||||||||
| Backport Completed: | |||||||||||||
| Steps To Reproduce: | PHP 5.6.7 (cli) (built: Mar 23 2015 01:51:22) Mongo Driver Version 1.6.4 Here is my code https://gist.github.com/OzzyCzech/f8201b22eadcabf5a8c6 |
||||||||||||
| Sprint: | Quint Iteration 3.1.2 | ||||||||||||
| Participants: | |||||||||||||
| Description |
| Comments |
| Comment by Githook User [ 09/Apr/15 ] |
|
Author: {u'username': u'jrassi', u'name': u'Jason Rassi', u'email': u'rassi@10gen.com'}Message: (cherry picked from commit 93c8c001e4462a1f0c0eeed12901fadbdc1861d8) |
| Comment by Githook User [ 08/Apr/15 ] |
|
Author: {u'username': u'jrassi', u'name': u'Jason Rassi', u'email': u'rassi@10gen.com'}Message: |
| Comment by Jeremy Mikola [ 06/Apr/15 ] |
OzzyCzech: Since the service command itself is being deprecated and ultimately removed in 3.2, no driver will be able to do that when running against a 3.2+ server. Since drivers do need to support older server versions and preserve their existing API, the eval command methods will still be around. PHP's API is unfortunate in this respect, as our helper method is historically named execute(), which means some users aren't aware it is a wrapper for eval. We have added a warning to MongoDB::execute()'s documentation to note that the server command is deprecated.
Unless you're using a driver abstraction (e.g. Doctrine MongoDB) that implements a convenience method for mapReduce, you will need to use MongoDB::command(). The usage examples include a demonstration of executing mapReduce. If you're concerned about code clutter (assuming you invoke mapReduce in numerous places), you could always abstract that into a method in your application that mimics the shell's db.collection.mapReduce() method. |
| Comment by Roman [X] [ 06/Apr/15 ] |
|
Hi, thanks for quick response. Will be there any way how to execute simple Javascripts from PHP since eval is deprecated? Or we will need rewrite everything to command or mapReduce to cluttering PHP arrays? Roman |
| Comment by J Rassi [ 06/Apr/15 ] |
|
Hi, Thanks for reporting this issue. I can confirm that a fatal assertion failure is triggered when the "eval" command is used invoke the "mapReduce" command with a non-inline "out" option. This is a regression introduced in MongoDB 3.0.0. As a workaround, you can invoke the map-reduce functionality directly with the "mapReduce" command, instead of using the "eval" command. From your PHP application, use the MongoDB::command() helper instead of the MongoDB::execute() helper. Please continue to watch this ticket for updates on when a fix will be available. ~ Jason Rassi |