[SERVER-32522] set_read_and_write_concerns.js treats mapReduce "out" field like aggregation's $out stage Created: 03/Jan/18  Updated: 30/Oct/23  Resolved: 31/Jan/18

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: 3.2.20, 3.4.14, 3.6.3, 3.7.2

Type: Bug Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Max Hirschhorn
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-32691 Create passthrough for w="majority" w... Closed
Duplicate
is duplicated by SERVER-21012 Update read majority passthrough to o... Closed
Problem/Incident
Related
related to SERVER-60823 runCommandWithRetries in JS test fram... Backlog
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.6, v3.4, v3.2
Sprint: TIG 2018-02-12
Participants:
Linked BF Score: 0

 Description   

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.



 Comments   
Comment by Githook User [ 23/Feb/18 ]

Author:

{'email': 'max.hirschhorn@mongodb.com', 'name': 'Max Hirschhorn', 'username': 'visemet'}

Message: SERVER-32522 Fix lint.
Branch: v3.2
https://github.com/mongodb/mongo/commit/85f80aac4fe252a7d4e8e4d532a11d0621d558ac

Comment by Githook User [ 23/Feb/18 ]

Author:

{'email': 'max.hirschhorn@mongodb.com', 'name': 'Max Hirschhorn', 'username': 'visemet'}

Message: SERVER-32522 Clean up

{read,write}

Concern and readPreference overrides.

Introduces OverrideHelpers object with convenience methods for
inspecting certain aggregation and map-reduce commands, as well as
overriding startParallelShell(), Mongo.prototype.runCommand(), and
Mongo.prototype.runCommandWithMetadata().

Also removes a number of tests that were incorrectly blacklisted from
the read_concern_majority_passthrough.yml and
read_concern_linearizable_passthrough.yml test suites.

(cherry picked from commit 35b5b72146ca570b5c6fed8aaa7e891edf7d6a78)
(cherry picked from commit e828226f4c5ab12835e10a09f104759e8fbf09f3)
Branch: v3.2
https://github.com/mongodb/mongo/commit/029f51d0fd9fd9ba0f921094d9cc174fd7a44944

Comment by Githook User [ 14/Feb/18 ]

Author:

{'email': 'max.hirschhorn@mongodb.com', 'name': 'Max Hirschhorn', 'username': 'visemet'}

Message: SERVER-32522 Clean up

{read,write}

Concern and readPreference overrides.

Introduces OverrideHelpers object with convenience methods for
inspecting certain aggregation and map-reduce commands, as well as
overriding startParallelShell(), Mongo.prototype.runCommand(), and
Mongo.prototype.runCommandWithMetadata().

Also removes a number of tests that were incorrectly blacklisted from
the read_concern_majority_passthrough.yml and
read_concern_linearizable_passthrough.yml test suites.

(cherry picked from commit 35b5b72146ca570b5c6fed8aaa7e891edf7d6a78)
(cherry picked from commit e828226f4c5ab12835e10a09f104759e8fbf09f3)
Branch: v3.4
https://github.com/mongodb/mongo/commit/5217cd27eabdc090baecf25e9b6d33e5c2eee6ad

Comment by Githook User [ 12/Feb/18 ]

Author:

{'email': 'max.hirschhorn@mongodb.com', 'name': 'Max Hirschhorn', 'username': 'visemet'}

Message: SERVER-32522 Clean up

{read,write}

Concern and readPreference overrides.

Introduces OverrideHelpers object with convenience methods for
inspecting certain aggregation and map-reduce commands, as well as
overriding startParallelShell(), Mongo.prototype.runCommand(), and
Mongo.prototype.runCommandWithMetadata().

Also removes a number of tests that were incorrectly blacklisted from
the read_concern_majority_passthrough.yml and
read_concern_linearizable_passthrough.yml test suites.

(cherry picked from commit 35b5b72146ca570b5c6fed8aaa7e891edf7d6a78)
(cherry picked from commit e828226f4c5ab12835e10a09f104759e8fbf09f3)
Branch: v3.6
https://github.com/mongodb/mongo/commit/3536849e28ba1d01eda1b280abd4ef62087b7107

Comment by Githook User [ 31/Jan/18 ]

Author:

{'email': 'max.hirschhorn@mongodb.com', 'name': 'Max Hirschhorn', 'username': 'visemet'}

Message: SERVER-32522 Remove j=true writeConcern from $changeStream test.
Branch: master
https://github.com/mongodb/mongo/commit/e828226f4c5ab12835e10a09f104759e8fbf09f3

Comment by Max Hirschhorn [ 31/Jan/18 ]

Reopening this ticket to address a test failure when running jstests/change_streams/change_stream_invalidation.js against the inMemory storage engine.

[js_test:change_stream_invalidation] 2018-01-31T02:58:02.289+0000 2018-01-31T02:58:02.287+0000 E QUERY    [thread1] Error: write command failed: {
[js_test:change_stream_invalidation] 2018-01-31T02:58:02.290+0000 	"ok" : 0,
[js_test:change_stream_invalidation] 2018-01-31T02:58:02.290+0000 	"errmsg" : "cannot use 'j' option when a host does not have journaling enabled",
[js_test:change_stream_invalidation] 2018-01-31T02:58:02.290+0000 	"code" : 2,
[js_test:change_stream_invalidation] 2018-01-31T02:58:02.290+0000 	"codeName" : "BadValue",
[js_test:change_stream_invalidation] 2018-01-31T02:58:02.290+0000 	"$clusterTime" : {
[js_test:change_stream_invalidation] 2018-01-31T02:58:02.290+0000 		"clusterTime" : Timestamp(1517367482, 1),
[js_test:change_stream_invalidation] 2018-01-31T02:58:02.290+0000 		"signature" : {
[js_test:change_stream_invalidation] 2018-01-31T02:58:02.290+0000 			"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
[js_test:change_stream_invalidation] 2018-01-31T02:58:02.290+0000 			"keyId" : NumberLong(0)
[ReplicaSetFixture:job3:primary] 2018-01-31T02:58:02.291+0000 I NETWORK  [conn12] end connection 127.0.0.1:38063 (0 connections now open)
[js_test:change_stream_invalidation] 2018-01-31T02:58:02.291+0000 		}
[js_test:change_stream_invalidation] 2018-01-31T02:58:02.291+0000 	}
[js_test:change_stream_invalidation] 2018-01-31T02:58:02.291+0000 } :
[js_test:change_stream_invalidation] 2018-01-31T02:58:02.291+0000 _getErrorWithCode@src/mongo/shell/utils.js:25:13
[js_test:change_stream_invalidation] 2018-01-31T02:58:02.291+0000 doassert@src/mongo/shell/assert.js:16:14
[js_test:change_stream_invalidation] 2018-01-31T02:58:02.291+0000 assert.writeOK@src/mongo/shell/assert.js:574:13
[js_test:change_stream_invalidation] 2018-01-31T02:58:02.291+0000 @jstests/change_streams/change_stream_invalidation.js:96:1
[js_test:change_stream_invalidation] 2018-01-31T02:58:02.292+0000 @jstests/change_streams/change_stream_invalidation.js:3:2
[js_test:change_stream_invalidation] 2018-01-31T02:58:02.292+0000 failed to load: jstests/change_streams/change_stream_invalidation.js

Comment by Githook User [ 31/Jan/18 ]

Author:

{'email': 'max.hirschhorn@mongodb.com', 'name': 'Max Hirschhorn', 'username': 'visemet'}

Message: SERVER-32522 Clean up

{read,write}

Concern and readPreference overrides.

Introduces OverrideHelpers object with convenience methods for
inspecting certain aggregation and map-reduce commands, as well as
overriding startParallelShell(), Mongo.prototype.runCommand(), and
Mongo.prototype.runCommandWithMetadata().

Also removes a number of tests that were incorrectly blacklisted from
the read_concern_majority_passthrough.yml and
read_concern_linearizable_passthrough.yml test suites.
Branch: master
https://github.com/mongodb/mongo/commit/35b5b72146ca570b5c6fed8aaa7e891edf7d6a78

Generated at Thu Feb 08 04:30:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.