Coverity: add GUARDED_BY to OplogFetcher 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 in `OplogFetcher` accessed without the mutex. Add `REQUIRES(_mutex)` to private helpers that read or write them. Fix all callers that must acquire the lock before invoking those helpers.

      Files: `oplog_fetcher.cpp` (lines 361, 507, 720).

      Resolves: SERVER-110035, SERVER-111631, SERVER-112316

      Why

      Oplog fetcher state is accessed across executor-callback boundaries where lock ownership is ambiguous. Because Coverity cannot be run locally, `GUARDED_BY` annotations give the compiler the same visibility as the analyzer — a clean build proves the locking contract is satisfied for these fields, and regressions are caught at build time.

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

              Created:
              Updated: