Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-12972

DBClientReplicaSet should ignore value of "inline" field of MapReduce commands

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.1.9
    • Affects Version/s: 2.6.0-rc0
    • Component/s: Internal Client
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Platform 9 (09/18/15)

      The server reacts to the presence of an "inline" field and ignores its value. This means that even {inline:false} is treated as an inline MapReduce. The C++ driver should use the same rules.

      Original description:

      Noticed this in 2.6.0-rc0's source, but the code probably goes back much further. I'm not sure if this affects sharding, since it may just respect the driver's read preference – but I assume DBClientReplicaSet is the C++ driver.

      The C++ driver (or whatever DBClient is) expects a truthy value: https://github.com/mongodb/mongo/blob/3779bf419438d2625277cf3c1c7216c497f683a8/src/mongo/client/dbclient_rs.cpp#L256

      ...but the MR execution code only cares that it's a key: https://github.com/mongodb/mongo/blob/3779bf419438d2625277cf3c1c7216c497f683a8/src/mongo/db/commands/mr_common.cpp#L72

      For context, see: https://github.com/mongodb/mongo-php-driver/pull/598#discussion_r10183536

      We only document {inline: 1} in http://docs.mongodb.org/manual/reference/command/mapReduce/#output-inline, but technically, only the key is relevant.

            Assignee:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: