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

Add TSAN annotations to our custom locks

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Catalog and Routing
    • 2
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      TSAN supports tagging custom mutex implementations with annotations so that they also participate in the various checks TSAN performs, e.g. potential deadlock detection.

      This is the interface, for instance when read locking a resource we'd need to call __tsan_mutex_pre_lock(&lock, __tsan_mutex_read_lock)

      This would extend the deadlock detector introduced by SERVER-99150

      Some open questions are:

      • TSAN requires an address to the mutex, our locks are identified by ResourceIds. One idea jordi.olivares-provencio@mongodb.com proposed is to have a global registry of ResourceIds in a std::set that we can reference, since it guarantees pointer stability.
      • Can we easily bypass the checks when we want? For instance for multi document transactions. We might need a wrapper to the TSAN APIs that checks these special cases.

            Assignee:
            Unassigned Unassigned
            Reporter:
            daniel.gomezferro@mongodb.com Daniel Gomez Ferro
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              None
              None
              None
              None