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

createIndexes command accepts "commitQuorum" option on 4.2 servers

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 4.2.5
    • Fix Version/s: 4.2.6
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Minor Change
    • Operating System:
      ALL
    • Steps To Reproduce:
      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" }
    • Sprint:
      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

          Issue Links

            Activity

              People

              Assignee:
              gregory.wlodarek Gregory Wlodarek
              Reporter:
              patrick.freed Patrick Freed
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: