[SERVER-33093] catalog::openCatalog must rebuild all indexes for a collection in one pass Created: 02/Feb/18 Updated: 29/Oct/23 Resolved: 13/Feb/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Index Maintenance, Storage |
| Affects Version/s: | None |
| Fix Version/s: | 3.7.3 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Daniel Gottlieb (Inactive) | Assignee: | Kyle Suarez |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | rollback-functional | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Operating System: | ALL | ||||||||||||||||
| Sprint: | Repl 2018-02-12, Repl 2018-02-26 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
KVStorageEngine::reconcileCatalogAndIdents returns a list of (collection name, index name) pairs that need to be rebuilt. If a collection requires rebuilding multiple indexes, they will be separate entries in this list. This API suggests that rebuilding indexes one by one would work, but that's unfortunately not true.[1] There are two obvious ways to correct catalog::openCatalog rebuilding indexes one by one.
[1] More completely: creating the collection object will cascade and create all of the in-memory index objects for that collection. The WiredTigerIndex constructor will fail when searching for the underlying table. rebuildIndexesOnCollection avoids this situation by first dropping all indexes that are to be rebuilt from the storage engine's implementation of the collection catalog. Thus when the Collection object is constructed, it does not observe the indexes to be rebuilt. Thus this bug only manifests when there is more than one missing index to rebuild on a collection. |
| Comments |
| Comment by Siyuan Zhou [ 14/Feb/18 ] | ||||||
|
Since the commit got reverted, no BF was filed according to the BF procedure. Tracking the issue in | ||||||
| Comment by Kyle Suarez [ 14/Feb/18 ] | ||||||
|
Filed | ||||||
| Comment by Kyle Suarez [ 14/Feb/18 ] | ||||||
|
daniel.gottlieb, looks like reconcileCatalogAndIdents() shouldn't include unready indexes in the list of indexes to rebuild when the --noIndexBuildRetry option is set:
If we want to fix this, should we just open a separate ticket to track the work, given that we won't revert the other commit (which is the main point of this ticket)? | ||||||
| Comment by Kyle Suarez [ 14/Feb/18 ] | ||||||
|
I'm glad I committed them separately siyuan.zhou, could you please link any build failures caused by that commit to this ticket? | ||||||
| Comment by Githook User [ 14/Feb/18 ] | ||||||
|
Author: {'email': 'siyuan.zhou@mongodb.com', 'name': 'Siyuan Zhou', 'username': 'visualzhou'}Message: Revert " This reverts commit 91b0a8c599cae1a130f8450e37681b3a134b5dd6. | ||||||
| Comment by Githook User [ 13/Feb/18 ] | ||||||
|
Author: {'email': 'kyle.suarez@mongodb.com', 'name': 'Kyle Suarez', 'username': 'ksuarz'}Message: | ||||||
| Comment by Githook User [ 13/Feb/18 ] | ||||||
|
Author: {'email': 'kyle.suarez@mongodb.com', 'name': 'Kyle Suarez', 'username': 'ksuarz'}Message: |