[SERVER-48245] index drop allowed on drop-pending collection Created: 15/May/20 Updated: 29/Oct/23 Resolved: 04/Jun/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Storage |
| Affects Version/s: | None |
| Fix Version/s: | 4.7.0, 4.4.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Louis Williams | Assignee: | Benety Goh |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Operating System: | ALL | ||||||||||||||||
| Backport Requested: |
v4.4
|
||||||||||||||||
| Sprint: | Execution Team 2020-06-15 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Linked BF Score: | 19 | ||||||||||||||||
| Description |
|
When a collection is being dropped using old-style two phase drops (system.drop.* introduced in 3.6), there is a small window in which we may be able to drop indexes on the collection. using its drop-pending namespace. This produces an sequence of operations that may be problematic for a secondary to apply. This is not a common scenario in production because it requires the user to be able to derive the drop-pending namespace of the dropped collection, either from the logs or the oplog, and run the dropIndexes command on the primary before it is permanently removed by the DropPendingCollectionReaper. ------ OLD DESCRIPTION BELOW ------ Old title: Old-style two-phase drops replicate 'dropIndexes' operations after collection 'drop' Old-style two-phase drops write an initial 'drop' oplog entry to rename the collection to a drop-pending namespace. The DropPendingCollectionReaper asynchronously drops the collection, which also drops the indexes and replicates the "dropIndexes" oplog entries. As a result, the "drop" oplog entry replicates before the "dropIndexes" entry. If a secondary has already applied the "drop" and performed the second drop phase, when it applies the "dropIndexes" operation it will encounter a NamespaceNotFound error in replication, which leads to a crash. |
| Comments |
| Comment by Githook User [ 08/Sep/20 ] |
|
Author: {'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}Message: (cherry picked from commit 34b89472092922061c29dbfe72f1f8e4051f7856) |
| Comment by Githook User [ 08/Sep/20 ] |
|
Author: {'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}Message: (cherry picked from commit 93ffa1d804ba78948b1def7134678c28f1dea1b8) |
| Comment by Githook User [ 08/Sep/20 ] |
|
Author: {'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}Message: (cherry picked from commit 6762642daa0cd703873af2d9e364a723d5a64c58) |
| Comment by Benety Goh [ 04/Jun/20 ] |
|
Author: {'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}Message: |
| Comment by Benety Goh [ 03/Jun/20 ] |
|
Author: {'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}Message: |
| Comment by Githook User [ 03/Jun/20 ] |
|
Author: {'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}Message: |
| Comment by Benety Goh [ 31/May/20 ] |
|
We should look into how the DropPendingCollectionReaper is able to replicate "dropIndexes" oplog entries while replicated writes are disabled. |