createIndexes command accepts "commitQuorum" option on 4.2 servers

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.2.6
    • Affects Version/s: 4.2.5
    • Component/s: 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
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

              Assignee:
              Gregory Wlodarek
              Reporter:
              Patrick Freed
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: