The secondary's index build thread should spin in a loop before finishing up and committing the index.
The secondary will do nothing while spinning in a loop. It should drop all locks. SERVER-39458 will add functionality to the loop, of periodically reacquiring the lock and running side table draining.
On receipt of the commitIndexBuild oplog entry, the secondary should signal the index build to commit with a timestamp passed in the oplog entry. The oplog applier thread will need to drop locks to allow the index build to take the X lock for index commit – I believe this should be safe, since 'c' oplog entries are applied serially, and so dropping the lock is OK. IndexBuildsCoordinator::commitIndexBuild will need to fetch a Future from the index build to return to the oplog applier thread to wait upon for commit completion.
SERVER-39533 will be done after this ticket and will hook up the abortIndexBuild oplog entry so that alternatively the index build on the secondary can be aborted while it's spinning in that loop waiting for commit. In case that's a design consideration.
Do not try to act on abort/commit signals earlier in the index build on secondaries than that spinning loop that waits for commit/abort. This is the simple first iteration implementation, we'll make it fancier in a subsequent ticket.
- depends on
-
SERVER-43192 fix checks for missing abortIndexBuild fields during oplog application
- Closed
-
SERVER-38605 IndexBuildsCoordinator writes commitIndexBuild oplog entry only in FCV 4.4
- Closed
-
SERVER-39068 Replication of simultaneous index builds startIndexBuild and commitIndexBuild oplog entries
- Closed
-
SERVER-39533 Hook up abortIndexBuild such that primaries write it on simul index build failure, and secondaries handle its receipt.
- Closed
-
SERVER-42760 emit no-op commitIndexBuild oplog entry on successful createIndexes command
- Closed
-
SERVER-42762 recover to timestamp should ignore no-op commitIndexBuild
- Closed
-
SERVER-42763 rollback via refetch should ignore no-op commitIndexBuild
- Closed
-
SERVER-42764 improve test assertion message in two_phase_index_build.js
- Closed
-
SERVER-43023 emit no-op startIndexBuild oplog entry on successful createIndexes command
- Closed
-
SERVER-43024 secondary oplog application should ignore no-op startIndexBuild entry
- Closed
-
SERVER-43025 rollback should ignore no-op startIndexBuild oplog entry
- Closed
-
SERVER-43026 AuthenticationManager should handle startIndexBuild
- Closed
-
SERVER-43190 rollback should ignore no-op abortIndexBuild oplog entry
- Closed
-
SERVER-43191 AuthenticationManager should handle abortIndexBuild
- Closed
-
SERVER-43295 Secondaries should start index build on receiving startIndexBuild oplog entry
- Closed
- is depended on by
-
TOOLS-2374 Support 4.4 index build oplog entries
- Closed
-
SERVER-39458 Add continuous draining on secondary's index build thread while it awaits a commitIndexBuild oplog entry
- Closed
-
SERVER-39462 Enhance index build logic on secondaries (for simul index builds) to abort early when signaled by an abortIndexBuild oplog entry
- Closed
-
SERVER-43301 add no_passthrough to two phase index builds evergreen builder
- Closed
- related to
-
SERVER-43612 secondary fails to start index build due to in-progress aborted index build with duplicate name
- Closed