[SERVER-33336] Snapshot reads should not take MODE_IX locks when autocommit=true Created: 14/Feb/18  Updated: 29/Oct/23  Resolved: 02/Mar/18

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 3.7.3

Type: Bug Priority: Major - P3
Reporter: Tess Avitabile (Inactive) Assignee: Tess Avitabile (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-32880 Add autocommit parameter to transacti... Closed
depends on SERVER-33004 Add two-phase locking for snapshot reads Closed
Related
is related to SERVER-33143 Hold MODE_IX locks for readConcern le... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Storage NYC 2018-03-12
Participants:

 Description   

Following SERVER-33143, snapshot reads always take MODE_IX locks. However, they should only take MODE_IX locks as part of multi-statement transactions, i.e. when autocommit is false. Snapshot reads with autocommit=true should take MODE_IS locks.



 Comments   
Comment by Githook User [ 02/Mar/18 ]

Author:

{'email': 'tess.avitabile@mongodb.com', 'name': 'Tess Avitabile', 'username': 'tessavitabile'}

Message: SERVER-33336 Snapshot reads should not take MODE_IX locks when autocommit=true
Branch: master
https://github.com/mongodb/mongo/commit/b1624b3fb1fe7eaf4554682d02c57abc519db819

Comment by Tess Avitabile (Inactive) [ 27/Feb/18 ]

Actually, I disagree with my above statement. If we are in a multi-statement transaction, we will take IX locks, so we do not need to two-phase lock for shared locks. So it is appropriate to decide to two-phase lock based on the readConcern.

Comment by Tess Avitabile (Inactive) [ 20/Feb/18 ]

It would also be desirable to decide whether to two-phase lock based on whether we are in a transaction, rather than based on the read concern, as we do here.

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