[SERVER-44609] Replicate startIndexBuild oplog entry in the same thread as the index build. Created: 13/Nov/19  Updated: 29/Oct/23  Resolved: 03/Dec/19

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

Type: Improvement 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:
Depends
Problem/Incident
Related
related to SERVER-44250 startIndexBuild oplog write and threa... Closed
related to SERVER-45262 make IndexBuildsCoordinator thread po... Closed
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2019-12-02, Execution Team 2019-12-16
Participants:
Linked BF Score: 20

 Description   

We replicate the "startIndexBuild" oplog entry on the caller thread, then schedule the index build task on a thread pool. This leads to a deadlock scenario described in SERVER-44250. That ticket will fix the issue with a mutex, but it depends on the internal queuing implementation of the thread pool.

To guarantee index builds are scheduled correctly, we should really replicate the oplog entry on the index build thread, rather than the caller.



 Comments   
Comment by Githook User [ 03/Dec/19 ]

Author:

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

Message: SERVER-44609 Replicate startIndexBuild oplog entry in the same thread as the index build

Instead of initializing and replicating the startIndexBuild oplog entry
on the caller thread, this moves that logic into the builder thread. This
change removes the need for a mutex which previously made that operation atomic.
Branch: master
https://github.com/mongodb/mongo/commit/d84c908c148e2bd8a4cecec7e4b417ebaacd91ce

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