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

Command log lines should include ok: 0 and errmsg:"..."

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.7.2
    • None
    • Diagnostics
    • None
    • Minor Change
    • Sharding 2017-12-04, Sharding 2018-01-01, Sharding 2017-12-18, Sharding 2018-01-29, Sharding 2018-02-12

    Description

      Results from commands are often not available. This means that when commands are logged, if only the logfile is available it is impossible to know whether the command succeeded or failed.

      Thus log lines for failed commands should indicate ok:0, and include any errmsg:"..." that was in the command response.

      For example, the following situation:

      > rs.stepDown()
      replset:PRIMARY> rs.stepDown()
      {
          "closest" : NumberLong(0),
          "difference" : NumberLong(1434366203),
          "ok" : 0,
          "errmsg" : "no secondaries within 10 seconds of my optime"
      }
      

      should be logged as:

      -2015-06-15T21:39:43.507+1000 [conn8] command admin.$cmd command: replSetStepDown { replSetStepDown: 60.0 } keyUpdates:0 numYields:0  reslen:132 0ms
      +2015-06-15T21:39:43.507+1000 [conn8] command admin.$cmd command: replSetStepDown { replSetStepDown: 60.0 } keyUpdates:0 numYields:0  ok:0 errMsg:"no secondaries within 10 seconds of my optime" errName:ExceededTimeLimit errCode:50 reslen:132 0ms
      

      Attachments

        Activity

          People

            kevin.pulo@mongodb.com Kevin Pulo
            kevin.pulo@mongodb.com Kevin Pulo
            Votes:
            4 Vote for this issue
            Watchers:
            14 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: