[SERVER-44045] allow secondary index builds to start without unlocking the RSTL Created: 16/Oct/19 Updated: 17/Apr/20 Resolved: 17/Apr/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Storage |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Benety Goh | Assignee: | Louis Williams |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||
| Sprint: | Execution Team 2019-11-04, Execution Team 2020-05-04 | ||||||||||||||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||||||||||||||
| Linked BF Score: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
One of the planned improvements related to two phase index builds require secondary nodes in a replica set to be able to continue to run index builds on stepping up to primary. This requires the new primary node to hold the RSTL in order to write the commitIndexBuild or abortIndexBuild entries to the oplog. Index builds on secondary nodes current unlock the RSTL before starting (specifically, the scanning, draining, and completion phases). This logic was introduced in In To support two phase index builds, it would be desirable to remove the RSTL unlocking logic. |
| Comments |
| Comment by Louis Williams [ 17/Apr/20 ] |
|
This is fixed by |
| Comment by Suganthi Mani [ 13/Nov/19 ] |
|
benety.goh, 1) Hybrid index build gets started on secondary for a collection A. And, collection phase of hybrid index build on secondary gets yielded. (Makes all the mongoDB and document level locks to get released - abandons the snapshot). And, the repro script will be the same as the one attached in |
| Comment by Benety Goh [ 18/Oct/19 ] |
|
Was there a reproduction script provided for |
| Comment by Judah Schvimer [ 16/Oct/19 ] |
|
What's the alternative to unlocking the RSTL? I think if we remove the collection S/X locks that index builds acquire then we could. I don't remember us having any alternative to unlocking the RSTL when we added that code. |
| Comment by Benety Goh [ 16/Oct/19 ] |
|
judah.schvimer, suganthi.mani, any thoughts? |