[SERVER-39452] Add rollback via refetch logic for startIndexBuild, abortIndexBuild, commitIndexBuild Created: 08/Feb/19  Updated: 29/Oct/23  Resolved: 16/Dec/19

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

Type: Task Priority: Major - P3
Reporter: Dianna Hohensee (Inactive) Assignee: Louis Williams
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-39484 Add step-up and step-down state trans... Closed
depends on SERVER-44350 write rollback tests for two phase in... Closed
Related
related to SERVER-39451 Add recover to a stable timestamp log... Closed
related to SERVER-39559 On rollback simul index builds are in... Closed
related to SERVER-42763 rollback via refetch should ignore no... Closed
related to SERVER-44045 allow secondary index builds to start... Closed
related to SERVER-44186 allow index builds to continue runnin... Closed
is related to SERVER-43867 Work around unrecoverability of rollb... Closed
is related to SERVER-46994 checkDBHashesForReplSet is not robust... Closed
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2019-12-02, Execution Team 2019-12-16
Participants:
Story Points: 5

 Description   

Read the relevant design documents sections for details / edge case handling.



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

Author:

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

Message: SERVER-39452 rollback_index_builds_test should not create collections implicitly
Branch: master
https://github.com/mongodb/mongo/commit/0cf959f95a5e2360c5340e6d6a75b2a69690e827

Comment by Githook User [ 16/Dec/19 ]

Author:

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

Message: SERVER-39452 Support rollback via refetch for two-phase index builds
Branch: master
https://github.com/mongodb/mongo/commit/59152df7655101ee551d6432727170b42fcd136f

Comment by Louis Williams [ 15/Oct/19 ]

I put up a quite detailed patch here with much of the necessary logic, most of which is covered in the design. The complete logic is as follows:

  • If a startIndexBuild entry is rolled back:
    • If the index build is active, kill it
    • (missing from my patch): If the index build is in the set of "indexBuildsToRestart", remove it to prevent it from being restarted. Skip the next step, since the index will already be in the "indexesToDrop" set.
    • If no index build is active, add it to the set of "indexesToDrop"
  • If an abortIndexBuild entry is rolled back:
    • (missing from my patch) Add it to the set of "indexesToDrop", which will be dropped before any indexes are restarted.
    • Add it to the set of "indexBuildsToRestart", which will restart the index build in the background, but not commit it before rollback completes
  • If a dropIndexes entry is rolled back:
    • Add it to the set of "indexesToCreate", which will build the index build in the foreground and commit it.
  • If a commitIndexBuild entry is rolled back:
    • If any of the indexes are in the set of "indexesToCreate", remove them, since the index cannot be committed.
    • (missing from my patch)  Add it to the set of "indexesToDrop", which will be dropped before any indexes are restarted.
    • Add it to the set of "indexBuildsToRestart", which will restart the index build in the background, but not commit it before rollback completes
Comment by Louis Williams [ 15/Oct/19 ]

In order for rollback to work correctly, secondaries need to be able to signal index builds to commit when the transition to primary on step-up. This work is dependent on SERVER-39452 for now.

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