Coverity: add GUARDED_BY to TopologyVersionObserver state

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Replication
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      What

      Add `GUARDED_BY(_mutex)` to the member fields accessed without the mutex in `TopologyVersionObserver`. Add `REQUIRES(_mutex)` to private helpers that read or write them.

      Files: `topology_version_observer.cpp` (lines 142, 211, 222).

      Resolves: SERVER-109416, SERVER-111266, SERVER-112564

      Why

      The observer accesses shared state from executor callbacks where lock ownership is easy to get wrong. Because Coverity cannot be run locally, `GUARDED_BY` annotations are the practical way to confirm the fix is complete and to prevent these fields from being accessed without the lock in the future.

            Assignee:
            Unassigned
            Reporter:
            Denis Trailin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: