[SERVER-62272] Adding schema validation to a collection can prevent chunk migrations of failing documents Created: 24/Dec/21 Updated: 29/Oct/23 Resolved: 31/May/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | 5.1.0, 4.4.10 |
| Fix Version/s: | 4.4.15, 5.0.10, 4.2.22, 6.0.0-rc9, 6.1.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Alex Bevilacqua | Assignee: | Nandini Bhartiya |
| 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: |
v6.0, v5.0, v4.4, v4.2
|
||||||||||||||||
| Sprint: | Sharding 2022-05-02, Sharding NYC 2022-05-16, Sharding NYC 2022-05-30, Sharding NYC 2022-06-13 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Case: | (copied to CRM) | ||||||||||||||||
| Linked BF Score: | 61 | ||||||||||||||||
| Story Points: | 3 | ||||||||||||||||
| Description |
|
When Schema Validation is added to a collection then that collection is sharded, if any documents existed that would fail validation chunk migration will also fail. For example:
Using the above sharded cluster we will create a collection with some junk data, then add a validation rule to ensure no further documents would be written using the same schema:
If we try to write another document it should fail:
If the collection was then sharded, sh.status() would simply show that no chunks were being migrated:
Reviewing the other shard's PRIMARY log we can see the following:
This can be addressed by logging into each shard's PRIMARY and running collMod to set validationLevel: "off", however as these moveChunk.error aren't logged in the changelog it's not obvious what has failed without a deeper dive. |
| Comments |
| Comment by Githook User [ 21/Jun/22 ] |
|
Author: {'name': 'nandinibhartiyaMDB', 'email': 'nandini.bhartiya@mongodb.com', 'username': 'nandinibhartiyaMDB'}Message: |
| Comment by Githook User [ 09/Jun/22 ] |
|
Author: {'name': 'nandinibhartiyaMDB', 'email': 'nandini.bhartiya@mongodb.com', 'username': 'nandinibhartiyaMDB'}Message: (cherry picked from commit bc1ac6fb2eb66202d1acc08d158b102c57beabbd) |
| Comment by Githook User [ 08/Jun/22 ] |
|
Author: {'name': 'nandinibhartiyaMDB', 'email': 'nandini.bhartiya@mongodb.com', 'username': 'nandinibhartiyaMDB'}Message: |
| Comment by Githook User [ 07/Jun/22 ] |
|
Author: {'name': 'nandinibhartiyaMDB', 'email': '104035932+nandinibhartiyaMDB@users.noreply.github.com', 'username': 'nandinibhartiyaMDB'}Message: |
| Comment by Githook User [ 01/Jun/22 ] |
|
Author: {'name': 'nandinibhartiyaMDB', 'email': '104035932+nandinibhartiyaMDB@users.noreply.github.com', 'username': 'nandinibhartiyaMDB'}Message: (cherry picked from commit bc1ac6fb2eb66202d1acc08d158b102c57beabbd) |
| Comment by Githook User [ 31/May/22 ] |
|
Author: {'name': 'nandinibhartiyaMDB', 'email': '104035932+nandinibhartiyaMDB@users.noreply.github.com', 'username': 'nandinibhartiyaMDB'}Message: |
| Comment by Alex Bevilacqua [ 29/Dec/21 ] |
|
I've also opened |