[SERVER-61945] Resharding collection cloning may fail with NamespaceNotSharded when "nearest" read preference chooses secondary Created: 07/Dec/21 Updated: 29/Oct/23 Resolved: 09/Dec/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 5.3.0, 5.1.2, 5.0.6, 5.2.0-rc1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Max Hirschhorn | Assignee: | Max Hirschhorn |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | sharding-nyc-subteam1 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Operating System: | ALL | ||||||||||||||||
| Backport Requested: |
v5.2, v5.1, v5.0
|
||||||||||||||||
| Sprint: | Sharding 2021-12-13 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Linked BF Score: | 40 | ||||||||||||||||
| Story Points: | 2 | ||||||||||||||||
| Description |
|
It is possible due to a mirrored read or an earlier failed resharding operation for a secondary to be aware of the temporary resharding namespace and to believe the collection is unsharded. A primary is guaranteed to have refreshed its CatalogCache after the config.chunks entries have been written on the config server primary. However, there is no equivalent guarantee for secondaries. This can lead the call to CatalogCache::getShardedCollectionRoutingInfo() in the $_internalReshardingOwnershipMatch stage to throw a NamespaceNotSharded exception. We can instead use CatalogCache::getShardedCollectionRoutingInfoWithRefresh() to ensure the secondary will have refreshed after the config.chunks entries have been written on the config server primary and also know the temporary resharding namespace is sharded.
|
| Comments |
| Comment by Githook User [ 09/Dec/21 ] |
|
Author: {'name': 'Max Hirschhorn', 'email': 'max.hirschhorn@mongodb.com', 'username': 'visemet'}Message: (cherry picked from commit 19e8f275378c4ba4a2941ae2eb10249c915ed0f1) |
| Comment by Githook User [ 09/Dec/21 ] |
|
Author: {'name': 'Max Hirschhorn', 'email': 'max.hirschhorn@mongodb.com', 'username': 'visemet'}Message: (cherry picked from commit 19e8f275378c4ba4a2941ae2eb10249c915ed0f1) |
| Comment by Githook User [ 09/Dec/21 ] |
|
Author: {'name': 'Max Hirschhorn', 'email': 'max.hirschhorn@mongodb.com', 'username': 'visemet'}Message: (cherry picked from commit 19e8f275378c4ba4a2941ae2eb10249c915ed0f1) |
| Comment by Githook User [ 09/Dec/21 ] |
|
Author: {'name': 'Max Hirschhorn', 'email': 'max.hirschhorn@mongodb.com', 'username': 'visemet'}Message: |