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

Disallow createIndexes and createCollection from running inside transactions that explicitly specify non-local readConcern

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.4.0-rc0, 4.7.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v4.4
    • Execution Team 2020-03-23, Execution Team 2020-04-06

      The test concurrent_drops_and_creates.js can be modified to create a scenario where createIndexes and createCollection can fail with the following message:

      "Command create does not support { readConcern: { level: \"snapshot\", provenance: \"clientSupplied\" } } :: caused by :: read concern not supported",

      This failure occurs if concurrent_drops_and_creates.js explicitly creates a collection or an index inside this transaction (instead of the highlighted lines), and is run inside sharded_jscore_txns.

      I spun up a ShardingTest locally and attempted the same sequence of events as this test, but I did not run into the error, which leads me to believe something about the testing configuration results in readConcern getting explicitly forwarded to the cluster create and cluster createIndexes commands.

      Note that this error does not occur when running the same test (with the above modification) in replica_sets_jscore_passthrough.

      As an update, it looks like in order to reproduce this error, createCollection/createIndexes needs to be run after another operation inside a transaction. If either is the first operation inside the transaction, the error does not occur.

            Assignee:
            maria.vankeulen@mongodb.com Maria van Keulen
            Reporter:
            maria.vankeulen@mongodb.com Maria van Keulen
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: