[SERVER-68781] Check value of hidden maxChunkSizeBytes Created: 12/Aug/22 Updated: 05/Dec/22 Resolved: 04/Oct/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 4.4.15, 5.0.10, 4.2.22 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Allison Easton | Assignee: | [DO NOT USE] Backlog - Sharding EMEA |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | sharding-wfbf-day | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Sharding EMEA
|
||||||||
| Operating System: | ALL | ||||||||
| Steps To Reproduce: | |||||||||
| Participants: | |||||||||
| Description |
|
In versions 4.2 - 5.0, there is a hidden parameter to the moveChunk command which can be used to specify the max chunk size to move. However, there are not any checks on what this value can be set to. This can cause problems if the value is set to NaN or a negative value. We should check that the passed in value is a positive number and throw invalid options otherwise. This parameter was removed in 5.3, so is not a problem on versions greater than this. Passing NaN can also result in different behavior depending on the architecture and version: x86 v4.2 -> max chunk size set to 2^64 bytes and entering critical section during transfer mods not allowed v4.4 & 5.0 -> max chunk size set to -2^63 and max number of documents to transfer set to 2 arm v4.2, 4.4, & 5.0 -> max chunk size set to the default
So we should separately check that the value is a number and that it is not negative so that the behavior is consistent across architectures |
| Comments |
| Comment by Tommaso Tocci [ 04/Oct/22 ] |
|
You can only hit this issue if you are doing a manual moveChunk and using an undocumented parameter, additionally the problem has been already resolved in versions > 5.0. |