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

setSlaveOk has no effect with group() queries

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Duplicate
    • Affects Version/s: 1.4.1, 1.4.3
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
    • Operating System:
      ALL

      Description

      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 }

      ]

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: