[SERVER-32345] Check if we need to initial sync before rebuilding unfinished indexes Created: 14/Dec/17  Updated: 27/Oct/23  Resolved: 29/Aug/18

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Judah Schvimer Assignee: Tess Avitabile (Inactive)
Resolution: Gone away Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-25075 Building 2dsphere index uses excessiv... Closed
Sprint: Repl 2018-09-10
Participants:

 Description   

We first restart in-progress indexes: https://github.com/mongodb/mongo/blob/a08d6998928720aeea25546dca785f242b6b102d/src/mongo/db/db.cpp#L926 , and then we start replication: https://github.com/mongodb/mongo/blob/a08d6998928720aeea25546dca785f242b6b102d/src/mongo/db/db.cpp#L958
, which is where we check for initial sync. Creating indexes can take a very long time and we should skip this if we're going to go into initial sync immediately.



 Comments   
Comment by Tess Avitabile (Inactive) [ 29/Aug/18 ]

The call to restartInProgressIndexesFromLastShutdown() is always a no-op for replica set members, since indexes are rebuilt using rebuildIndexes().

Comment by Eric Milkie [ 14/Dec/17 ]

This seems like an optimization that almost no one would encounter in practice.

Generated at Thu Feb 08 04:29:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.