This was changed in SERVER-40938.
In 3.6 and 4.0, mapReduce can be run in a causally consistent session.
In 4.2-latest after SERVER-40938, mapReduce fails in a causally consistent session with the error: "afterClusterTime is not allowed for this command"
[2019/05/24 10:49:08.880] ERROR [0.014s]: test_reads (test_session.TestCausalConsistency) [2019/05/24 10:49:08.880] ---------------------------------------------------------------------- [2019/05/24 10:49:08.880] Traceback (most recent call last): [2019/05/24 10:49:08.880] File "/data/mci/9f1a1b826c664870d59ae599ad910a7c/src/test/__init__.py", line 410, in wrap [2019/05/24 10:49:08.880] return f(*args, **kwargs) [2019/05/24 10:49:08.880] File "/data/mci/9f1a1b826c664870d59ae599ad910a7c/src/test/test_session.py", line 848, in test_reads [2019/05/24 10:49:08.880] lambda coll, session: coll.map_reduce( [2019/05/24 10:49:08.880] File "/data/mci/9f1a1b826c664870d59ae599ad910a7c/src/test/test_session.py", line 826, in _test_reads [2019/05/24 10:49:08.880] op(coll, sess) [2019/05/24 10:49:08.880] File "/data/mci/9f1a1b826c664870d59ae599ad910a7c/src/test/test_session.py", line 849, in <lambda> [2019/05/24 10:49:08.880] 'function() {}', 'function() {}', 'inline', session=session)) [2019/05/24 10:49:08.880] File "/data/mci/9f1a1b826c664870d59ae599ad910a7c/src/pymongo/collection.py", line 2803, in map_reduce [2019/05/24 10:49:08.880] ReadPreference.PRIMARY, **kwargs) [2019/05/24 10:49:08.880] File "/data/mci/9f1a1b826c664870d59ae599ad910a7c/src/pymongo/collection.py", line 2741, in _map_reduce [2019/05/24 10:49:08.880] user_fields=user_fields) [2019/05/24 10:49:08.880] File "/data/mci/9f1a1b826c664870d59ae599ad910a7c/src/pymongo/collection.py", line 247, in _command [2019/05/24 10:49:08.880] user_fields=user_fields) [2019/05/24 10:49:08.880] File "/data/mci/9f1a1b826c664870d59ae599ad910a7c/src/pymongo/pool.py", line 584, in command [2019/05/24 10:49:08.880] user_fields=user_fields) [2019/05/24 10:49:08.880] File "/data/mci/9f1a1b826c664870d59ae599ad910a7c/src/pymongo/network.py", line 158, in command [2019/05/24 10:49:08.880] parse_write_concern_error=parse_write_concern_error) [2019/05/24 10:49:08.880] File "/data/mci/9f1a1b826c664870d59ae599ad910a7c/src/pymongo/helpers.py", line 155, in _check_command_response [2019/05/24 10:49:08.880] raise OperationFailure(msg % errmsg, code, response) [2019/05/24 10:49:08.880] pymongo.errors.OperationFailure: afterClusterTime is not allowed for this command
We might also want to document this change in the map_reduce helper docs.
- is caused by
-
SERVER-40938 Add tests that dbhash and map-reduce do not accept a read concern
- Closed