[SERVER-7789] mapReduce on a sharded collection fails with $readPreference Created: 28/Nov/12  Updated: 15/Feb/13  Resolved: 17/Dec/12

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 2.2.2
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Randolph Tan
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
Related
is related to SERVER-7791 Commands wrapped in $query reports wr... Closed
Operating System: ALL
Steps To Reproduce:

First, shard the collection that you're map/reducing over.
Then, run a command like:

mongos> db.runCommand( { "mapreduce" : "test", map : "function() {}", reduce : "function() {}", out :

{inline:1}

, "$readPreference" :

{ mode : "primary"}

} )

{ "ok" : 0, "errmsg" : "unknown m/r field for sharding: $readPreference" }
Participants:

 Description   

Running a mapReduce against mongos on a sharded collection with a driver that supports $readPreference produces a server error:

{ "serverUsed" : "localhost/127.0.0.1:30999" , "ok" : 0.0 , "errmsg" : "unknown m/r field for sharding: $readPreference"}

 Comments   
Comment by zhu daniel [ 29/Nov/12 ]

i got this problem too after i run m/r with 2.10.0 version of java driver. so changed the java driver to 2.9.1. now it works ok.

Generated at Thu Feb 08 03:15:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.