[SERVER-47360] Should only take a collection MODE_IX lock for creating system.profile Created: 06/Apr/20  Updated: 29/Oct/23  Resolved: 09/Apr/20

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

Type: Improvement Priority: Major - P3
Reporter: Geert Bosch Assignee: Gregory Noma
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-55034 The profile command should not take S... Closed
Related
related to SERVER-55034 The profile command should not take S... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.4, v4.2
Sprint: Execution Team 2020-04-20
Participants:

 Description   

At introspect.cpp, we take a database MODE_X lock and have some complicated looping code to deal with those locking issues. Now we can create collections with just a collection MODE_IX lock, this is no longer necessary and we can reduce the complexity.

We should also investigate what we currently do for profiling inside of transactions.



 Comments   
Comment by Githook User [ 10/Apr/20 ]

Author:

{'name': 'Gregory Noma', 'email': 'gregory.noma@gmail.com', 'username': 'gregorynoma'}

Message: SERVER-47360 Take collection MODE_IX lock instead of database MODE_X lock when creating system.profile

(cherry picked from commit b0e3eed55a031a43ddc9674c71da7c3e5e59eb64)
Branch: v4.4
https://github.com/mongodb/mongo/commit/a6806eb23504a4bc0d69434caad282665f4708cb

Comment by Githook User [ 09/Apr/20 ]

Author:

{'name': 'Gregory Noma', 'email': 'gregory.noma@gmail.com', 'username': 'gregorynoma'}

Message: SERVER-47360 Take collection MODE_IX lock instead of database MODE_X lock when creating system.profile
Branch: master
https://github.com/mongodb/mongo/commit/b0e3eed55a031a43ddc9674c71da7c3e5e59eb64

Comment by Eric Milkie [ 07/Apr/20 ]

Profiling inside of transactions was quite tricky. I believe we profile after we stash the transaction, so that the profile write appears in a separate transaction and is committed immediately, in turn so that the profiling results do not need to wait for the multi-document transaction to commit or abort before the profile results are visible.

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