Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-96142

SharedReplSetConfig::setConfig() should use WithLock

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

      setConfig() is only called from ReplicationCoordinatorImpl::_setCurrentRSConfig, when the replication coordinator mutex is already held.

      However it looks like we should always be holding the replication coordinator mutex when making changes to the config - this can be enforced by having setConfig() take a WithLock argument the same way getConfig(WithLock) does.

      It would also be nice if we can add more information to getConfig(WithLock) describing when it is to be called versus the lock-free version. (From a quick reading of the code, we seem to use it whenever we want to make sure that the config cannot change underneath us - and the only way to use getConfig(WithLock) is to grab the replication coordinator first, which ensures that setConfig() cannot be called.)

            Assignee:
            Unassigned Unassigned
            Reporter:
            vishnu.kaushik@mongodb.com Vishnu Kaushik
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: