[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:
Related
is related to SERVER-46995 Convert ReplIndexBuildState from stru... Closed
is related to SERVER-47252 Remove Collection and Database IndexB... Closed
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: SERVER-47415 Move data structures for tracking active index builds out of IndexBuildsCoordinator
Branch: master
https://github.com/mongodb/mongo/commit/b4c6fc5e2cc368c0efa3ca7252a3fd2cb4f54abd

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 SERVER-47252.

Generated at Thu Feb 08 05:14:08 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.