Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-98571

Fix manual entry for dbstats and enforce bounds on scale argument

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            binh.vo@mongodb.com Binh Vo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: