Coverity: replace SharedPromise readLock with writeLock in ReplicationCoordinatorImpl

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Replication
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      What

      Replace `readLock()` with `writeLock()` for all `SharedPromise::emplaceValue` and `SharedPromise::setError` calls on the promise at line 2083 of `replication_coordinator_impl.h`.

      Files: `replication_coordinator_impl.h` (line 2083).

      Resolves: SERVER-108524

      Why

      `SharedPromise` allows only one fulfillment; using `readLock()` at the fulfillment site permits concurrent writers, violating the single-write contract and producing a data race. Replacing it with `writeLock()` restores mutual exclusion. Because Coverity cannot be run locally, the type change is the verifiable proof — Coverity's model for `SharedPromise::writeLock` enforces the single-writer constraint.

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

              Created:
              Updated: