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

[4.4] mongod collStats does not handle large values for scale

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 4.4.5
    • Fix Version/s: 4.4.7
    • Component/s: Storage
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Execution Team 2021-05-17, Execution Team 2021-05-31

      Description

      When the collStats command is given a scale value that is too large for the integer type, a 4.4 server may fail with a BadValue error. This behavior was addressed in 4.9 and 5.0 when the collStats option handling was converted to using a IDL-generated parser that uses BSONElement::safeNumberInt().

      4.4.5:
       
      > db.t.insert({_id: 0})
      WriteResult({ "nInserted" : 1 })
      > db.t.stats().storageSize
      4096
      > db.t.stats(100).storageSize
      40
      > db.t.stats(Number.MAX_VALUE).storageSize
      > db.t.stats(Number.MAX_VALUE)
      { "ns" : "test.t", "ok" : 0, "errmsg" : "scale has to be >= 1" }
       
      4.9.0-rc1:
       
      > db.t.insert({_id: 0})
      WriteResult({ "nInserted" : 1 })
      > db.t.stats().storageSize
      4096
      > db.t.stats(100).storageSize
      40
      > db.t.stats(Number.MAX_VALUE).storageSize
      0
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              benety.goh Benety Goh
              Reporter:
              benety.goh Benety Goh
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: