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

Replace CollectionShardingRuntime and DatabaseShardingState use of interruptible ResourceMutex

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Catalog and Routing
    • CAR Team 2024-06-10, CAR Team 2024-06-24, CAR Team 2024-07-08, CAR Team 2024-07-22, CAR Team 2024-08-05, CAR Team 2024-08-19, CAR Team 2024-09-02, CAR Team 2024-09-16, CAR Team 2024-09-30, CAR Team 2024-10-14, CAR Team 2024-10-28, CAR Team 2024-11-11, CAR Team 2024-11-25
    • 2

      The CollectionShardingRuntime and DatabaseShardingState types use ResourceMutex to protect their internal in-memory state. This requires significant use of the UninterruptibleLockGuard, as these locks must be acquired even in interrupted contexts to repair in-memory data structure state before an operation concludes.

      We can get rid of UninterruptibleLockGuard usage in these types if we replace the use of the interruptible ResourceMutex. We can either use the new WriteRarelyMutex or the proposed RWMutex to replace this usage, or if the current behavior of ResourceMutex is otherwise preferred, simply add an uninterruptible resource-mutex type to the lock manager. This is preferrable to the use of the existing ULG because it prevents the proliferation of it's usage and the accidental use of the ULG for taking hierarchical/database locks.

      In this ticket, lets pick a replacement suitable for CSR and DSS, and then remove the usages of UninterruptibleLockGuard.

            Assignee:
            daniel.gomezferro@mongodb.com Daniel Gomez Ferro
            Reporter:
            george.wangensteen@mongodb.com George Wangensteen
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: