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

feature compatibility version writes must check for writeErrors

    • Fully Compatible
    • ALL
    • v3.4
    • Query 2017-10-23

      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 }
      

            Assignee:
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Reporter:
            judah.schvimer@mongodb.com Judah Schvimer
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: