[SERVER-46249] Disallow createIndexes and createCollection from running inside transactions that explicitly specify non-local readConcern Created: 19/Feb/20  Updated: 29/Oct/23  Resolved: 30/Mar/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.4.0-rc0, 4.7.0

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

Issue Links:
Backports
Depends
Documented
is documented by DOCS-13476 Investigate changes in SERVER-46249: ... Closed
Related
related to SERVER-45692 Ensure all internal inter-node comman... Closed
related to SERVER-46971 Support createIndexes and createColle... Backlog
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Sprint: Execution Team 2020-03-23, Execution Team 2020-04-06
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 31/Mar/20 ]

Author:

{'name': 'Maria van Keulen', 'email': 'maria@mongodb.com', 'username': 'mvankeulen94'}

Message: SERVER-46249 Check individual txn statements for readConcern support

(cherry picked from commit 75f04844c16c161ff963acfa91112009de455a9b)
Branch: v4.4
https://github.com/mongodb/mongo/commit/cd032301013093c56f2525a1153b87d3d44e084d

Comment by Githook User [ 30/Mar/20 ]

Author:

{'name': 'Maria van Keulen', 'email': 'maria@mongodb.com', 'username': 'mvankeulen94'}

Message: SERVER-46249 Check individual txn statements for readConcern support
Branch: master
https://github.com/mongodb/mongo/commit/75f04844c16c161ff963acfa91112009de455a9b

Generated at Thu Feb 08 05:10:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.