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

set_read_and_write_concerns.js treats mapReduce "out" field like aggregation's $out stage

    • Fully Compatible
    • ALL
    • v3.6, v3.4, v3.2
    • TIG 2018-02-12
    • 0

      else if (cmdName === "mapReduce") {
          var stages = obj.pipeline;
          const lastStage = stages && Array.isArray(stages) && (stages.length !== 0)
              ? stages[stages.length - 1]
              : undefined;
          const hasOut =
              lastStage && (typeof lastStage === 'object') && lastStage.hasOwnProperty('$out');
          if (hasOut) {
              forceWriteConcern = true;
          }
      }
      

      https://github.com/mongodb/mongo/blob/276bc00ce7a5086a4524cf8d57c68a3ac5f32c8c/jstests/libs/override_methods/set_read_and_write_concerns.js#L156-L166

      It should instead check to see whether {out: {inline: 1}} was specified similar to what is being done in set_read_preference_secondary.js. We should also define some helper functions for determining whether the command object is (a) an "aggregate" command with a $out stage, or (b) a "mapReduce" (or "mapreduce") command with non-inline output to avoid duplicating logic across both set_read_and_write_concerns.js and set_read_preference_secondary.js.

            Assignee:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: