[SERVER-27520] Allow unsigned types for MONGO_EXPORT_SERVER_PARAMETER Created: 27/Dec/16 Updated: 28/Jul/17 Resolved: 27/Dec/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | James Wahlin | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
We currently restrict server parameters to be bool, int, long long or double (see here). It would be useful if we could specify unsigned types as well as many of the parameters we define are unsigned by definition. |
| Comments |
| Comment by James Wahlin [ 27/Dec/16 ] |
|
Closing with "Won't Fix" as this improvement is likely not worth the added complexity it would introduce. |
| Comment by James Wahlin [ 27/Dec/16 ] |
|
For the query_knobs.h use case all numbers fit within a 32bit signed integer and represent duration, count or size. If support for this adds complexity and/or makes this mechanism more error prone then it is probably not worth doing. We haven't run into a real-world problem using signed integers for our needs. |
| Comment by Andy Schwerin [ 27/Dec/16 ] |
|
I generally dislike using unsigned types of arithmetic will be done on them because it is surprisingly error prone. Also, as originally conceived, server parameters were going to be settable via bson description, which makes support for unsigned more difficult. Do you want this for bit masks, or for numbers that are larger than 2^63-1 and less than 2^64? |
| Comment by James Wahlin [ 27/Dec/16 ] |
|
This request stems from a code review of the query_knobs.h file where many of the server parameters defined represent size and would benefit from an unsigned definition. |