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

Confusing Map / Reduce output when sharded

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 1.9.1
    • Affects Version/s: 1.8.0-rc2
    • Component/s: Sharding
    • Labels:
      None
    • Environment:
      Any

      In a sharded environment, the output of the "mapreduce" command is confusing.

      Following is a map-reduce that generates a "tags" collection. That "tags" collection contains 5077 documents.

      Problems:
      #1: There is no indication of 5077 anywhere in that output.
      #2: Based on the groups question, it looks like the output value from each shard may not be the last reduction for that node.
      So the output value for a node may misrepresent that data that is actually on that node.

      ======
      > db.runCommand(

      { mapreduce: 'test', map:map, reduce:reduce, out : 'tags'}

      );
      {
      "result" : "tags",
      "shardCounts" : {
      "localhost:6900" :

      { "input" : 36443, "emit" : 30756, "output" : 2906 }

      ,
      "localhost:6901" :

      { "input" : 18808, "emit" : 12933, "output" : 1948 }

      ,
      "localhost:6902" :

      { "input" : 27274, "emit" : 24070, "output" : 2765 }

      ,
      "localhost:6903" :

      { "input" : 45220, "emit" : 43915, "output" : 3742 }

      ,
      "localhost:6904" :

      { "input" : 48399, "emit" : 45688, "output" : 3842 }

      ,
      "localhost:6905" :

      { "input" : 27413, "emit" : 23050, "output" : 2837 }

      },
      "counts" :

      { "emit" : NumberLong(180412), "input" : NumberLong(203557), "output" : NumberLong(18040) }

      ,
      "ok" : 1,
      "timeMillis" : 10978,
      "timing" :

      { "shards" : 10609, "final" : 368 }

      }
      > db.tags.count()
      5077
      ======

      Associated groups question:
      http://groups.google.com/group/mongodb-user/browse_thread/thread/65869b34e4230a3b#

            Assignee:
            antoine Antoine Girbal
            Reporter:
            gatesvp Gaetan Voyer-Perrault
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: