[SERVER-50662] Support large doubles and other double values in FTDC Created: 31/Aug/20 Updated: 29/Oct/23 Resolved: 30/Sep/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.4.7, 5.0.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Mark Benvenuto | Assignee: | Mark Benvenuto |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Backport Requested: |
v5.0, v4.4
|
||||||||
| Sprint: | Security 2020-10-05 | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 56 | ||||||||
| Description |
|
FTDC converts doubles to int64. This leads to undefined behavior if the double is -inf, +inf or does not fit in [INT64_MIN, INT64_MAX]. This was detected by clang's ubsan sanitizer
References: |
| Comments |
| Comment by Githook User [ 11/Jun/21 ] | ||||||||||
|
Author: {'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com', 'username': 'markbenvenuto'}Message: (cherry picked from commit d47784296374ed335d07c895820fdf8066e538e3) | ||||||||||
| Comment by Githook User [ 29/Sep/20 ] | ||||||||||
|
Author: {'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com', 'username': 'markbenvenuto'}Message: | ||||||||||
| Comment by Bruce Lucas (Inactive) [ 02/Sep/20 ] | ||||||||||
|
That seems reasonable. | ||||||||||
| Comment by Mark Benvenuto [ 01/Sep/20 ] | ||||||||||
|
I have to define how FTDC will translate these double values that cannot be represented as int64. It will be a lossy transformation. I mostly see these large values as an error so I am okay with losing information. Here is an example of the transformation I am considering.
| ||||||||||
| Comment by Bruce Lucas (Inactive) [ 01/Sep/20 ] | ||||||||||
|
What did you have in mind by "support"? If you mean encode those values losslessly in FTDC, I'm dubious of the value, considering the impact in churn, complexity, and cost that would have for consumers. If you just mean encode them as 64-bit ints in a well-defined way, that seems reasonable. |