[SERVER-59829] Allow integers for parameters defined in idl as requiring doubles Created: 07/Sep/21 Updated: 29/Oct/23 Resolved: 15/Sep/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.1.0-rc0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Kelsey Schubert | Assignee: | Sara Golemon |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Sprint: | Security 2021-09-20 |
| Participants: |
| Description |
|
For example, if I want to disable mirrored reads, I'd like to execute the following command in mongosh:
However, this will lead to an error since the sampling rate is not a double. |
| Comments |
| Comment by Vivian Ge (Inactive) [ 06/Oct/21 ] | ||
|
Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you! | ||
| Comment by Githook User [ 15/Sep/21 ] | ||
|
Author: {'name': 'Sara Golemon', 'email': 'sara.golemon@mongodb.com', 'username': 'sgolemon'}Message: | ||
| Comment by Sara Golemon [ 15/Sep/21 ] | ||
|
The generalized handling in IDL server parameters actually handles loose coersion correctly already when it's a simple scalar value. Structured values (like mirrorReads) depend on how they're defined individually as structs. So for example here: https://github.com/mongodb/mongo/blob/master/src/mongo/db/mirror_maestro.idl#L44 `samplingRate` is defined as a `double` which requires strict typing, while the behavior you're looking for here (and indeed, what IMO most people expect) is `safeDouble`. I'll update this IDL definition as part of this ticket, but this is definitely a per-setting issue, not something that can be addressed broadly (there's an implied assumption that if the IDL author picked double over safeDouble or int over safeInt then they did so for a reason. | ||
| Comment by Kelsey Schubert [ 07/Sep/21 ] | ||
|
Note that this is more annoying because mongosh silently converts doubles to integers. Consequently our documentation is incorrect: https://docs.mongodb.com/manual/replication/#enable-disable-support-for-mirrored-reads Per
You would need to execute
If this work isn't feasible to prioritize, please file a DOCS ticket to review various parameter pages to ensure that the documented examples work. |