Coverity: add GUARDED_BY to topology observer, session cache, oplog buffers, and reporter

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

      What

      Add `GUARDED_BY(_mutex)` to unprotected member fields and `REQUIRES(_mutex)` to private helpers across the replication service layer.

      Files: `replication_coordinator_impl.cpp` (line 2489), `topology_version_observer.cpp` (lines 142, 211, 222), `logical_session_cache_impl.cpp` (lines 344, 346), `primary_only_service.cpp` (line 472), `reporter.cpp` (line 433), `oplog_buffer_batched_queue.cpp` (line 44), `oplog_buffer_blocking_queue.cpp` (line 84), `sessions_collection_rs.cpp` (line 67).

      Resolves: SERVER-109031, SERVER-109416, SERVER-111266, SERVER-112564, SERVER-109412, SERVER-112002, SERVER-109737, SERVER-111630, SERVER-112310, SERVER-112388, SERVER-112320

      Why

      These service-layer components operate under executor scheduling where lock ownership at callback boundaries is easy to get wrong. Because Coverity cannot be run locally, `GUARDED_BY` annotations are the practical way to verify a fix and ensure these variables cannot be accessed without the lock in the future — catching regressions at build time rather than in the next Coverity scan.

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

              Created:
              Updated: