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

negative opcounter values in serverStatus

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.6.1
    • Fix Version/s: 2.6.4, 2.7.3
    • Component/s: Diagnostics, Shell
    • Labels:
      None
    • Operating System:
      ALL
    • Backport Completed:
    • Steps To Reproduce:
      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.

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: