Coverity: add GUARDED_BY to oplog buffer queue 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 state fields in `OplogBufferBatchedQueue` and `OplogBufferBlockingQueue` accessed without the mutex. Add `REQUIRES(_mutex)` to the enqueue/dequeue paths that bypass the lock.

      Files: `oplog_buffer_batched_queue.cpp` (line 44), `oplog_buffer_blocking_queue.cpp` (line 84).

      Resolves: SERVER-112310, SERVER-112388

      Why

      Both buffer implementations share the same interface and the same access pattern — state written under lock in the hot path but readable from other threads. Because Coverity cannot be run locally, `GUARDED_BY` annotations are the practical way to confirm the fix is complete and to catch regressions at build time.

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

              Created:
              Updated: