[SERVER-54608] dropIndexes needs to make the same assertions on primary and secondary nodes Created: 18/Feb/21  Updated: 29/Oct/23  Resolved: 26/Feb/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 4.4.0
Fix Version/s: 4.9.0, 4.4.5

Type: Bug Priority: Critical - P2
Reporter: Louis Williams Assignee: Gregory Wlodarek
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Documented
is documented by DOCS-14257 Investigate changes in SERVER-54608: ... Closed
Related
Backwards Compatibility: Minor Change
Operating System: ALL
Backport Requested:
v4.4
Sprint: Execution Team 2021-03-08
Participants:
Linked BF Score: 142

 Description   

The applyOps path for dropIndexes makes an assertion that the primary does not. This can lead to a bug that generates an invalid oplog sequence and causes all secondaries to stop replicating.

There is a bug that can be described by the following sequence in its simplest form:

  • Start building an index A
  • dropIndexes aborts A and yields its locks
  • Start building a new index build on A and commit
  • Start building an index B
  • dropIndexes reacquires its locks and sees that A is not in progress anymore, so it moves on to replicate a dropIndexes oplog entry instead.
  • The secondary sees the dropIndexes oplog entry for A but blocks in the applyOps path because B is still in progress, something that did not happen on the primary.

We need to either a) assert on the primary that no index builds are in progress when a single index is dropped, or b) remove the assertion for the applyOps path.



 Comments   
Comment by Githook User [ 05/Mar/21 ]

Author:

{'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}

Message: SERVER-54608 dropIndexes needs to make the same assertions on primary and secondary nodes

(cherry picked from commit c5ba08fe6ca78d4dabbc1df9f65d6e60abe5f097)
Branch: v4.4
https://github.com/mongodb/mongo/commit/42bcfe694a15151b1865743b2a2c973e4e5ec153

Comment by Githook User [ 26/Feb/21 ]

Author:

{'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}

Message: SERVER-54608 dropIndexes needs to make the same assertions on primary and secondary nodes
Branch: master
https://github.com/mongodb/mongo/commit/c5ba08fe6ca78d4dabbc1df9f65d6e60abe5f097

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