[SERVER-45055] Startup recovery should work with more than one unfinished two-phase index build Created: 11/Dec/19  Updated: 29/Oct/23  Resolved: 26/Mar/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.4.0-rc0, 4.7.0

Type: Bug Priority: Major - P3
Reporter: Louis Williams Assignee: Louis Williams
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Sprint: Execution Team 2020-03-23, Execution Team 2020-04-06
Participants:
Linked BF Score: 50

 Description   

Startup recovery for unfinished index builds first drops each index from the durable catalog before restarting the index build.

The recovery procedure then initializes the collection's in-memory state with Collection::init(). This also initializes the IndexCatalog, which invariants that all indexes in the durable catalog are ready.

If there is more than one unfinished index build, separate calls will be made to initialize the IndexCatalog for each build. The first call will fail on this invariant, because the second index has not been dropped yet.

Fixing this is tricky, because both the Collection and IndexCatalog can only be initialized once, and index builds need to be started in separate threads. Additionally, dropping and recreating indexes need to be part of the same storage transaction.



 Comments   
Comment by Githook User [ 02/Apr/20 ]

Author:

{'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}

Message: SERVER-45055 Startup recovery should work with more than one unfinished two-phase index build

(cherry picked from commit c2f9ac87298c390a4557876a6b2a6f9b836a7efd)
Branch: v4.4
https://github.com/mongodb/mongo/commit/717c79bf6031ceee5594e68b416c7874bfc6f5e2

Comment by Githook User [ 26/Mar/20 ]

Author:

{'email': 'louis.williams@mongodb.com', 'name': 'Louis Williams', 'username': 'louiswilliams'}

Message: SERVER-45055 Startup recovery should work with more than one unfinished two-phase index build
Branch: master
https://github.com/mongodb/mongo/commit/c2f9ac87298c390a4557876a6b2a6f9b836a7efd

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