Coverity: add GUARDED_BY to RollbackChecker state

XMLWordPrintableJSON

    • 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 protected members of `RollbackChecker` and `REQUIRES(_mutex)` to private helpers that access them. `_baseRBID`, `_lastRBID`, `_checkForRollback`, and `_setRBID` are already annotated in `rollback_checker.h`; verify the build is clean.

      Files: `rollback_checker.h`, `rollback_checker.cpp` (CIDs 175176, 175076).

      Resolves: SERVER-110703, SERVER-110882

      Why

      Incorrect rollback detection can leave a node with a diverged oplog. Because Coverity cannot be run locally, `GUARDED_BY` / `REQUIRES` annotations give the compiler the same visibility as the analyzer — a clean build proves the locking contract is satisfied, and any future change that reintroduces an unguarded access on these fields is caught immediately.

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

              Created:
              Updated: