-
Type:
Improvement
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Replication
-
Fully Compatible
-
v7.0
-
Repl 2024-06-10, Repl 2024-06-24, Repl 2024-07-08
-
(copied to CRM)
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.