-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Storage Execution
-
0
The dbStats manual, https://www.mongodb.com/docs/v8.0/reference/command/dbStats/ indicates that a `scale` argument can be specified to scale the output statistics and will be reported in the output as well. The entry says that non-integral values will be rounded down. Examining the code, this seems inaccurate, https://github.com/10gen/mongo/blob/07cf38fae394b0d439c88b6444cff2bcf45c2844/src/mongo/db/catalog/database_impl.cpp#L267 the values are instead scaled with the value as-is. Furthermore, we do not enforce any kind of bounds on the value for scale, which can be problematic as when we write the scale factor to the output, it is constrained to a `long long`, which may be insufficient to hold large `double` values.
We should think about sensible bounds for this argument, enforce them, and update the code and/or manual entry to be consistent.