[SERVER-50056] Collections can become views during shard version recovery Created: 31/Jul/20 Updated: 29/Oct/23 Resolved: 10/Aug/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 4.7.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Tommaso Tocci | Assignee: | Marcos José Grillo Ramirez |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | PM-1645-Milestone-1, sharding-wfbf-day | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Operating System: | ALL | ||||||||||||||||
| Sprint: | Sharding 2020-08-10 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Linked BF Score: | 7 | ||||||||||||||||
| Description |
|
onShardVersionMismatch possibly triggers a recovery of the collection's shard version. Calling onShardVersionMismatch with a namespace corresponding to a view doesn't make sense because the view is not versioned. For this reason we correctly throw an error if this happens. On the other hand during the recovery of the collection's shard version, it is possible that a view is created for the same namespace, thus it is not correct to throw an CommandNotSupportedOnView error on the exit snippet of the recoverRefreshShardVersion() function. I guess the fix would be as simple as changing kViewsForbidden to kViewsPermitted here. |
| Comments |
| Comment by Githook User [ 07/Aug/20 ] |
|
Author: {'name': 'Marcos José Grillo Ramírez', 'email': 'marcos.grillo@mongodb.com', 'username': 'm4nti5'}Message: |
| Comment by Marcos José Grillo Ramirez [ 04/Aug/20 ] |
|
To expand tommaso.tocci's comment, we should version the drop command sent to the shards, set to ignore the version (like the write command) so the drop is serialized behind a refresh, and handle the possible SSV now thrown by the shards. |
| Comment by Tommaso Tocci [ 03/Aug/20 ] |
|
As suggested by kaloian.manassiev in today's morning meeting this could happen only if we issue the drop and create view command directly to the shards. Because if we pass through the routers the drop and re-create operations they will serialize on top of the previous shard version recovery procedure. |