[SERVER-85870] Avoid waking up ready waiters twice when updating lastDurable opTime Created: 29/Jan/24  Updated: 05/Feb/24

Status: In Progress
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Wenbin Zhu Assignee: Brad Cater
Resolution: Unresolved Votes: 0
Labels: PM-3489-Milestone-MiscImprovement-CP
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-85600 [Milestone] Misc Improvement Checkpoint In Progress
Assigned Teams:
Replication
Sprint: Repl 2024-02-05, Repl 2024-02-19
Participants:

 Description   

Whenever we update the lastDurable timestamp, we do two things:

1) Update `lastCommitted` and `commit point` if WriteConcernMajorityShouldJournal == true, which would eventually call `_wakeReadyWaiters()` if the committed point is advanced.

2) Right after the above step, call `_wakeReadyWaiters` again.

This seems to be duplicate work as they are called under the same mutex, we could consider skip calling `_wakeReadyWaiters` in step 1) and only walk through all the waiters in step 2).

Note this is based on code inspection, we should double check this before doing the changes.


Generated at Thu Feb 08 06:58:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.