[SERVER-40049] Make OplogBuffer use ProducerConsumerQueue instead of BlockingQueue Created: 08/Mar/19 Updated: 22/Aug/23 Resolved: 22/Aug/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Matthew Russotto | Assignee: | Backlog - Replication Team |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Assigned Teams: |
Replication
|
||||||||||||
| Participants: | |||||||||||||
| Description |
|
The replication oplog buffer is the last and only user of BlockingQueue in https://github.com/mongodb/mongo/blob/master/src/mongo/util/queue.h It would be better if we could switch to the ProducerConsumerQueue in https://github.com/mongodb/mongo/blob/master/src/mongo/util/producer_consumer_queue.h, which is used elsewhere in the code. |
| Comments |
| Comment by Eric Milkie [ 12/Feb/20 ] |
|
Yeah sorry – those particular things were the original reasons that triggered me to write my own custom thread-safe queue in the first place.. |
| Comment by Matthew Russotto [ 12/Feb/20 ] |
|
Looks like queue.h may survive a bit longer. PCQ is missing some things – waitForSpace, clear, count of items in queue. Some of these are easy to add but I think clear() doesn't really fit with the way PCQ wants to do things. |
| Comment by Matthew Russotto [ 12/Feb/20 ] |
|
If we want to backport this to 4.2, we will need to backport |
| Comment by Eric Milkie [ 05/Feb/20 ] |
|
I'm just impressed that a class I wrote back in 2012 is still in use even today! I certainly didn't expect it to last this long.. commit f31d4d9acaee1e11f2ff0f1e84929ffb684ae053 implement max-size thread-safe queue class |