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

feature compatibility version writes must check for writeErrors

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.4.9, 3.5.13
    • Fix Version/s: 3.4.11, 3.6.0-rc1
    • Component/s: Replication, Write Ops
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.4
    • Sprint:
      Query 2017-10-23

      Description

      Here: https://github.com/mongodb/mongo/blob/c617c3efabb7ee6da6ec66fe9f585dfaeed631df/src/mongo/db/commands/feature_compatibility_version.cpp#L327-L332 we have:

          // Update the featureCompatibilityVersion document stored in the "admin.system.version"
          // collection.
          BSONObj updateResult;
          client.runCommand(nss.db().toString(), updateCmd.obj(), updateResult);
          uassertStatusOK(getStatusFromCommandResult(updateResult));
          uassertStatusOK(getWriteConcernStatusFromCommandResult(updateResult));
      

      Since this is doing an update, it can return a status like the following with ok:1 but a write error indicating that we should fail:

      { n: 0, nModified: 0, writeErrors: [ { index: 0, code: 62, errmsg: "Must be in primary or secondary state to downgrade feature compatibility version document { _id: "featureCompatibilityVersion", version: "3.4", targetV..." } ], ok: 1.0 }
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: