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

convertToCapped takes locks in a non-ResourceId order

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • Fully Compatible
    • ALL
    • CAR Team 2025-02-17
    • 200
    • 1

      The method attempts to take locks in source -> tmp collection order.

      However, a subsequent rename may take locks in tmp -> source order if the ResourceId order says so.

      Ideally locks should always be taken in ResourceId order to avoid deadlocks like these from occurring. Note that the likelihood of an actual issue here is quite low since it requires the random intermediate collection name to flip order based on the ResourceId and it has a very small window of possibility for other actors to target them.

            Assignee:
            jordi.olivares-provencio@mongodb.com Jordi Olivares Provencio
            Reporter:
            jordi.olivares-provencio@mongodb.com Jordi Olivares Provencio
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: