[SERVER-47415] move data structures for tracking active index builds in IndexBuildsCoordinator into separate class Created: 08/Apr/20 Updated: 29/Oct/23 Resolved: 03/Nov/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Storage |
| Affects Version/s: | None |
| Fix Version/s: | 4.9.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Benety Goh | Assignee: | Brian DeLeonardis (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Sprint: | Execution Team 2020-11-02, Execution Team 2020-11-16 | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
IndexBuildsCoordinator currently maintains a list of the active index builds in _allIndexBuilds synchronized using a mutex and a condition variable. Moving the data structures for maintaining this information, along with the many helpers for waiting/checking active index builds, into a separate class (eg. IndexBuildCatalog) may help to reduce the size of the IndexBuildsCoordinator code. |
| Comments |
| Comment by Githook User [ 03/Nov/20 ] |
|
Author: {'name': 'Brian DeLeonardis', 'email': 'brian.deleonardis@mongodb.com', 'username': 'bdeleonardis1'}Message: |
| Comment by Brian DeLeonardis (Inactive) [ 02/Nov/20 ] |
|
Code review: https://mongodbcr.appspot.com/702610001/ |
| Comment by Louis Williams [ 09/Oct/20 ] |
|
I can imagine a member class ActiveIndexBuilds that maintains the existing _allIndexBuilds map and mutex. We can forward all of the "assertIndexBuild" and "awaitIndexBuild" helpers to that class. The challenge will be to figure out how to handle this critical section where we hold the mutex to serialize registering new index builds. Edit: The Collection X lock should protect us in the last case I mentioned. |
| Comment by Benety Goh [ 08/Apr/20 ] |
|
This improvement was suggested during the code review for |