Coverity: add GUARDED_BY to ReplicationCoordinatorImpl heartbeat and catchup state

    • 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 the heartbeat and catchup paths of `ReplicationCoordinatorImpl`. Add `REQUIRES(_mutex)` to any private helper that reads them.

      Files: `replication_coordinator_impl_heartbeat.cpp` (lines 709, 732), `replication_coordinator_impl_catchup.cpp` (line 239).

      Resolves: SERVER-109413, SERVER-109686, SERVER-110888

      Why

      Heartbeat and catchup callbacks run on the executor thread while the same fields can be accessed from threads holding `_mutex`. Because Coverity cannot be run locally, `GUARDED_BY` annotations are the practical way to confirm the fix is complete — a clean build is the proof — and they 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: