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

setSlaveOk has no effect with group() queries

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 1.4.1, 1.4.3
    • Component/s: None
    • Labels:
      None
    • Environment:
    • ALL

      Executing db.getMongo().setSlaveOk() allows me to run a map reduce query on a replica pair slave but the equivalent group() query does not work. Reproduced on v1.4.1 and v1.4.3.

      Master:

      > db.sd_boxedice_checksLoadAvrg.group(
      ... {
      ... initial:

      {count: 0, running_average: 0}

      ,
      ... reduce: function(doc, out)
      ...

      { ... out.count++; ... out.running_average+=doc.v; ... },
      ... finalize: function(out)
      ... { ... out.average = out.running_average / out.count; ... }
      ... }
      ... );
      [
      { "count" : 204931, "running_average" : 131253.02999999493, "average" : 0.6404742571889803 }
      ]

      Slave


      > db.sd_boxedice_checksLoadAvrg.group(
      ... {
      ... initial: {count: 0, running_average: 0},
      ... reduce: function(doc, out)
      ... {... out.count++;... out.running_average+=doc.v;... }

      ,
      ... finalize: function(out)
      ...

      { ... out.average = out.running_average / out.count; ... }

      ... }
      ... );
      [

      { "count" : 1, "running_average" : NaN, "average" : NaN }

      ]

            Assignee:
            antoine Antoine Girbal
            Reporter:
            boxedice David Mytton
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: