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

Minimize the number of _doneWaitingForReplication_inlock calls needed to wake up writeConcern waiters

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Replication
    • Fully Compatible
    • v8.0, v7.0
    • Repl 2024-06-10, Repl 2024-06-24, Repl 2024-07-08

      Idea from jiawei.yang@mongodb.com in SERVER-89242:

      Maybe we can change the replicationWaiterList to an unordered_map<WriteConcernOptions, multimap<OpTime, SharedWaiterHandle>. Then every time we wake up waiters using opTime T, we only need to call doneWaitingForReplicationinlock(T, writeConcern) once for each write concern and then just invoke all the waiters in the corresponding multimap with opTime <= T.

      And now that our default writeConcern is majority, we should at least try this optimization for majority writes (if that's easier) and see if this helps with perf especially when there are lots of concurrent writeConcern waiters.

            Assignee:
            matthew.russotto@mongodb.com Matthew Russotto
            Reporter:
            lingzhi.deng@mongodb.com Lingzhi Deng
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: