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

Add writeConcernError backwards compatibility to User Management Commands

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.5
    • Affects Version/s: None
    • Component/s: Write Ops
    • None
    • Fully Compatible
    • ALL
    • Sharding 10 (02/19/16), Sharding 11 (03/11/16), Sharding 12 (04/01/16), Sharding 13 (04/22/16)

      When they receive a writeConcernError, write commands should return a response with the format:

      Unable to find source-code formatter for language: javascript. 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
      {
          ok: 1,
          ...
          writeConcernError: {
              code: <number>,
              errmsg: <string>
          }
      }
      

      User Managements Commands currently have a response format of

      {"ok" : 0, "errmsg" : "timeout", "code" : 8 }

      . These commands need to return the new format in addition to or instead of the old format. To do so, inside of Command::run(), when we get a writeConcernError we will simply check if the command is a UserManagementCommand and if so we will set ok to 0, and add "errmsg" and "code" fields with the errmsg and code from the writeConcernError.

            Assignee:
            judah.schvimer@mongodb.com Judah Schvimer
            Reporter:
            judah.schvimer@mongodb.com Judah Schvimer
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: