Coverity: add GUARDED_BY to ReplicationCoordinatorImpl, PrimaryOnlyService, Reporter, and SessionsCollectionRS

    • 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 unprotected member fields and `REQUIRES(_mutex)` to private helpers in four service-layer files.

      Files: `replication_coordinator_impl.cpp` (line 2489), `primary_only_service.cpp` (line 472), `reporter.cpp` (line 433), `sessions_collection_rs.cpp` (line 67).

      Resolves: SERVER-109031, SERVER-109737, SERVER-111630, SERVER-112320

      Why

      Each of these files has a single Coverity finding where a state field is accessed without the mutex in a path that runs on a different thread. Because Coverity cannot be run locally, `GUARDED_BY` annotations are the practical way to confirm each 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:
            1 Start watching this issue

              Created:
              Updated: