[SERVER-19766] Initial sync index build is sequential and single-threaded Created: 04/Aug/15 Updated: 17/Sep/15 Resolved: 17/Sep/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jon Rangel (Inactive) | Assignee: | Scott Hernandez (Inactive) |
| Resolution: | Done | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| Operating System: | ALL | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
In this comment in However, in testing with 3.0.5 I see that all indexes on a collection are built sequentially. Furthermore the speed of each index build is CPU-bound on a single CPU core. mongod log file from repro attached. |
| Comments |
| Comment by Scott Hernandez (Inactive) [ 17/Sep/15 ] | |||
|
Jon, thanks for confirming (in a sep. email) that the indexes are built in parallel per collection as the system is designed. We have improved the system to not apply the first/last operation in the oplog separately which was what you were initially seeing – | |||
| Comment by Roy Reznik [ 12/Sep/15 ] | |||
|
I am experiencing the exact same issue with MongoDB 3.0.6. | |||
| Comment by Scott Hernandez (Inactive) [ 05/Aug/15 ] | |||
|
If you add a document insert at the end, or create an index on another collection then you will see the indexes built at the same time. | |||
| Comment by Jon Rangel (Inactive) [ 05/Aug/15 ] | |||
|
Hi Scott, The repro steps are:
| |||
| Comment by Scott Hernandez (Inactive) [ 05/Aug/15 ] | |||
|
This is due to the fact that the last op in the source oplog, and the first used during the initial sync, was the create index command, which ran before the "bulk index" phase happened. If you can provide your reproduction script we can alter it slightly to verify this. | |||
| Comment by Jon Rangel (Inactive) [ 05/Aug/15 ] | |||
|
Log file attached. Covers period from startup of mongod with empty dbpath to completion of initial sync. |