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

negative opcounter values in serverStatus

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.6.4, 2.7.3
    • Affects Version/s: 2.6.1
    • Component/s: Diagnostics, Shell
    • None
    • ALL
    • Hide

      Perform operations against mongod that push one of the opcounters to an unsigned integer value that would be interpreted as negative if cast to a signed integer.

      Run db.serverStatus() via mongo shell.

      Show
      Perform operations against mongod that push one of the opcounters to an unsigned integer value that would be interpreted as negative if cast to a signed integer. Run db.serverStatus() via mongo shell.

      Issue Status as of Jul 22, 2014

      ISSUE SUMMARY
      The opcounter values that the serverStatus command returns are stored in mongod as an unsigned 32-bit integer, however serverStatus returns these values as a signed 32-bit integer. This can cause negative numbers to be displayed if the opcounter values are large enough.

      USER IMPACT
      This is a cosmetic issue, but can lead to confusion and obfuscate the real opcounter values. Custom scripts that parse these values may receive unexpected input.

      WORKAROUNDS
      A restart of the mongod server resets the opcounter values back to 0.

      AFFECTED VERSIONS
      All production releases from 2.6.0 to 2.6.3 are affected by the issue.

      FIX VERSION
      The fix is included in the 2.6.4 production release.

      RESOLUTION DETAILS
      The fix correctly resets the operation counters when any counter grows close to the maximum value of a signed 32-bit integer.

      Original description

      The opcounter values that the serverStatus command returns are stored in mongod as unsigned integer. serverStatus returns these values as a signed integer which can mean negative values if not converted back to unsigned.

      We should look to return the full positive value.

            Assignee:
            rassi J Rassi
            Reporter:
            james.wahlin@mongodb.com James Wahlin
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: