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

createIndexes command accepts "commitQuorum" option on 4.2 servers

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 4.2.6
    • 4.2.5
    • None
    • None
    • Minor Change
    • ALL
    • Hide

      > db.runCommand({createIndexes: "test", indexes: [{ name: "a", key: { a: 1 }}], commitQuorum: "all" })
      {
              "createdCollectionAutomatically" : false,
              "numIndexesBefore" : 5,
              "numIndexesAfter" : 6,
              "ok" : 1
      }
      > db.runCommand({createIndexes: "test", indexes: [{ name: "aaa", key: { xaaaaaa: 1 }}], asdfasdf: "all" })
      {
              "ok" : 0,
              "errmsg" : "Invalid field specified for createIndexes command: asdfasdf",
              "code" : 2,
              "codeName" : "BadValue"
      }
      

      Show
      > db.runCommand({createIndexes: "test" , indexes: [{ name: "a" , key: { a: 1 }}], commitQuorum: "all" }) {         "createdCollectionAutomatically" : false ,         "numIndexesBefore" : 5 ,         "numIndexesAfter" : 6 ,         "ok" : 1 } > db.runCommand({createIndexes: "test" , indexes: [{ name: "aaa" , key: { xaaaaaa: 1 }}], asdfasdf: "all" }) {         "ok" : 0 ,         "errmsg" : "Invalid field specified for createIndexes command: asdfasdf" ,         "code" : 2 ,         "codeName" : "BadValue" }
    • Execution Team 2020-04-20

    Description

      commitQuorum is accepted without error on 4.2 servers despite not having any effect on createIndexes (it does have an effect starting in 4.3/4.4). All other invalid options passed to createIndexes do return errors, and the drivers rely on this to communicate errors to end users. Since commitQuorum doesn't have an effect on 4.2, it should throw an error as if it's invalid too.

      Attachments

        Activity

          People

            gregory.wlodarek@mongodb.com Gregory Wlodarek
            patrick.freed@mongodb.com Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: