[SERVER-13082] createIndexes can return error without an error code Created: 06/Mar/14  Updated: 06/Dec/22  Resolved: 01/Feb/16

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: 2.6.0-rc1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: Backlog - Storage Execution Team
Resolution: Done Votes: 0
Labels: 26qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to DRIVERS-132 Use createIndexes command when available Closed
Assigned Teams:
Storage Execution
Operating System: ALL
Steps To Reproduce:

> 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"
}

Participants:

 Description   

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.



 Comments   
Comment by A. Jesse Jiryu Davis [ 06/Mar/14 ]

Inspecting the code, it appears there are multiple paths by which createIndexes will return a codeless error.

Generated at Thu Feb 08 03:30:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.