Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-1851

Test that mapReduce fails in a causally consistent session in 4.2

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.9
    • Affects Version/s: None
    • Component/s: Tests
    • None

      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.

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: