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

Don't take replication mutex twice when processing heartbeats

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

      When processing a heartbeat request, we end up unnecessarily taking the replication coordinator mutex twice because we guard the scope of the first mutex acquisition unnecessarily: once to check the config state and once for the duration of preparing the heartbeat response.

      During times of high contention for the mutex, where the time to process a heartbeat is dominated by the time it takes to take the mutex, this can mean it can take almost twice as long to prepare the heartbeat response.

      We should just take the mutex once without releasing it and re-acquiring it.

            Assignee:
            Unassigned Unassigned
            Reporter:
            samy.lanka@mongodb.com Samyukta Lanka
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: