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

createIndexes can return error without an error code

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.6.0-rc1
    • Component/s: Index Maintenance
    • Labels:
    • Storage Execution
    • ALL
    • Hide
      > db.runCommand({createIndexes: 'collection', indexes: {key: {a: 1}, name: 'a_1'}})
      {
      	"cmdObj" : {
      		"createIndexes" : "collection",
      		"indexes" : {
      			"key" : {
      				"a" : 1
      			},
      			"name" : "a_1"
      		}
      	},
      	"ok" : 0,
      	"errmsg" : "indexes has to be an array"
      }
      
      Show
      > db.runCommand({createIndexes: 'collection' , indexes: {key: {a: 1}, name: 'a_1' }}) { "cmdObj" : { "createIndexes" : "collection" , "indexes" : { "key" : { "a" : 1 }, "name" : "a_1" } }, "ok" : 0, "errmsg" : "indexes has to be an array" }

      This is particularly bad for drivers, since we assume that if a command fails with no code, it is because we are talking to an old server and the command does not exist, and we fall back to inserting into system.indexes.

            Assignee:
            backlog-server-execution [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: