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

Avoid taking ReplicationCoordinator mutex when deciding to gossip cluster times with external clients

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • v5.0, v4.4, v4.2, v4.0
    • Sharding 2021-07-12, Sharding 2021-07-26, Sharding 2021-08-09, Sharding 2021-08-23
    • 135

      To decide whether to gossip cluster times to and from external clients, mongod will check if it is in a readable state (as of SERVER-47568). Validating incoming cluster times requires having cached signing keys from admin.system.keys so this is meant to avoid persistent validation errors when a node enters an unreadable state.

      Currently, this check happens twice for each received external request and uses the ReplicationCoordinator method getMemberState(). This method takes the ReplicationCoordinator mutex, which is often contested and can have a performance impact on certain workloads. Instead, a method that does not take this mutex should be used, like ReplicationCoordinator::isInPrimaryOrSecondaryState().

            Assignee:
            randolph@mongodb.com Randolph Tan
            Reporter:
            jack.mulrow@mongodb.com Jack Mulrow
            Votes:
            0 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: