[SERVER-60811] Drop database could drop new collections after stepdown Created: 19/Oct/21 Updated: 29/Oct/23 Resolved: 26/Oct/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 5.2.0, 5.0.4, 5.1.0-rc3 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Marcos José Grillo Ramirez | Assignee: | Allison Easton |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Backport Requested: |
v5.1, v5.0
|
||||||||
| Sprint: | Sharding EMEA 2021-11-01 | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 148 | ||||||||
| Description |
|
The drop database command resends a drop collection command if finds that the previous execution was interrupted with a stepdown. This is done to ensure the collections are dropped even if a stepdown happened right after saving the coordinator document with the last collection to be dropped. However, if a stepdown happens after removing the database metadata and another shard manages to create a new database, then, the newly elected primary will end up dropping a collection that belongs to another database, which is not correct. A repro of this scenario can be found attached. In order to prevent this, we could clean the collection field of the coordinator document after all the collections are successfully dropped. |
| Comments |
| Comment by Githook User [ 28/Oct/21 ] |
|
Author: {'name': 'Allison Easton', 'email': 'allison.easton@mongodb.com', 'username': 'allisoneaston'}Message: (cherry picked from commit fe46db1c852640e6c63f3cfa2291fc6a728e88ac) |
| Comment by Githook User [ 28/Oct/21 ] |
|
Author: {'name': 'Allison Easton', 'email': 'allison.easton@mongodb.com', 'username': 'allisoneaston'}Message: (cherry picked from commit fe46db1c852640e6c63f3cfa2291fc6a728e88ac) |
| Comment by Githook User [ 25/Oct/21 ] |
|
Author: {'name': 'Allison Easton', 'email': 'allison.easton@mongodb.com', 'username': 'allisoneaston'}Message: |