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

Log scoped diagnostic data (e.g. in-progress client command) on invariant

    • Fully Compatible
    • Service Arch 2022-04-04, Service Arch 2022-04-18, Service Arch 2022-05-02, Service Arch 2022-05-16, Service Arch 2022-05-30, Service Arch 2022-06-13, Service Arch 2022-06-27, Service Arch 2022-07-11, Service Arch 2022-07-25, Service Arch 2022-08-08
    • 4

      If an invariant is hit while processing an incoming client command, the command being processed should be logged (as it would have been prior to running, if the COMMAND logLevel had been 2 or more).

      This is because by default commands are only logged after they have finished running, but this will never happen if an invariant kills the server midway through the command. Diagnostically it's invaluable to know the command (including arguments) that was in progress when the invariant triggered, and it's common to lament the absence of this info when invariants are hit in the field or in production (because it may not be possible to reproduce, and core dumps are unlikely to be available).

      Desired change:

      Unable to find source-code formatter for language: diff. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
       2019-05-08T02:25:10.859+0000 F -        [conn216296] Invariant failure params.descriptor src/mongo/db/query/stage_builder.cpp 102
      +2019-05-08T02:25:10.859+0000 F COMMAND  [conn216296] in-progress command: foo.$cmd { find: "bar", filter: { ... }, ... }
       2019-05-08T02:25:10.859+0000 F -        [conn216296]
        
       ***aborting after invariant() failure
       
       2019-05-08T02:25:10.912+0000 F -        [conn216296] Got signal: 6 (Aborted).
      

            Assignee:
            billy.donahue@mongodb.com Billy Donahue
            Reporter:
            kevin.pulo@mongodb.com Kevin Pulo
            Votes:
            3 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: