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

feature compatibility version writes must check for writeErrors

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 3.4.9, 3.5.13
    • 3.4.11, 3.6.0-rc1
    • Replication, Write Ops
    • None
    • Fully Compatible
    • ALL
    • v3.4
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: