[SERVER-66176] [v4.4/v4.2] Minimize work under CollectionCatalog mutex Created: 03/May/22  Updated: 29/Oct/23  Resolved: 17/May/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.4.15, 4.2.21

Type: Improvement Priority: Major - P3
Reporter: Henrik Edin Assignee: Henrik Edin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.2
Sprint: Execution Team 2022-05-30
Participants:

 Description   

The CollectionCatalog mutex can be a source of contention. There are some minor improvements that can be done without changing how the system works at a high level.

  1. Hash namespace/uuid without holding the lock
  2. Add interface to match call patterns. RequiresCollectionStage::doRestoreState makes two calls (requiring taking and releasing the mutex twice) for something that can be implemented as a single call.


 Comments   
Comment by Githook User [ 19/May/22 ]

Author:

{'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}

Message: SERVER-66176 Reduce work under CollectionCatalog lock

  • Perform hashing before taking lock.
  • Add new API for restoring after yield where we can lookup by UUID and verify namespace in the same critical section. Avoid two calls and copying the namespace under the lock.

(cherry picked from commit 7e0f7d50da0915428a3bfa10a656cd999d5fa10e)
Branch: v4.2
https://github.com/mongodb/mongo/commit/686303404d6faa0dde943deea549005baf46efb4

Comment by Githook User [ 11/May/22 ]

Author:

{'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}

Message: SERVER-66176 Reduce work under CollectionCatalog lock

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