[SERVER-74097] Sharded find with expected collection UUID does not handle all cases of concurrent DDL operations Created: 16/Feb/23 Updated: 29/Oct/23 Resolved: 17/Feb/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 7.0.0-rc0, 6.0.5, 6.3.0-rc1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Gregory Noma | Assignee: | Gregory Noma |
| 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: |
v6.3, v6.0
|
||||||||
| Sprint: | Execution Team 2023-02-20, Execution Team 2023-03-06 | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 129 | ||||||||
| Description |
|
When running a find command on a sharded collection with collectionUUID parameter, there is some special logic in the case where we don't target the primary shard but got a CollectionUUIDMismatch error without an actualCollection. In this case, we go to the primary shard in case the actualCollection is unsharded and thus only exists on that shard. The current logic expects that going to the primary shard will always throw an error (CollectionUUIDMismatch, StaleShardVersion, or StaleDbVersion), however it turns out this is not always the case and it is possible for no error to be thrown. Consider a concurrent collection drop on the collection that is being queried; it will executed in three steps:
If we go to the primary shard between steps 2 and 3, that shard will still have the collection despite not getting a stale version error. |
| Comments |
| Comment by Githook User [ 21/Feb/23 ] |
|
Author: {'name': 'Gregory Noma', 'email': 'gregory.noma@gmail.com', 'username': 'gregorynoma'}Message: |
| Comment by Githook User [ 21/Feb/23 ] |
|
Author: {'name': 'Gregory Noma', 'email': 'gregory.noma@gmail.com', 'username': 'gregorynoma'}Message: (cherry picked from commit 4c670108b0aa1f5903ddb0c4e74ab0cee518b151) |
| Comment by Githook User [ 17/Feb/23 ] |
|
Author: {'name': 'Gregory Noma', 'email': 'gregory.noma@gmail.com', 'username': 'gregorynoma'}Message: |