[SERVER-13142] 2.6 upgrade checker checks only for presence of _id index, not uniqueness Created: 11/Mar/14  Updated: 19/May/14  Resolved: 12/Mar/14

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

Type: Bug Priority: Major - P3
Reporter: Jonathan Reams Assignee: Matt Dannenberg
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

When running the upgrade checker, if a collection has an index on "_id" it doesn't complain if the index isn't unique, which generates a startup warning.

Upgrade checker output

www-c:SECONDARY> db.upgradeCheck({db: "aux_www_devel", collection: "web_exceptions"})
Checking collection 'aux_www_devel.web_exceptions' for 2.6 upgrade compatibility
 
Checking collection aux_www_devel.web_exceptions
Everything in 'aux_www_devel.web_exceptions' is ready for the upgrade!
true

Get indexes output

www-c:SECONDARY> use aux_www_devel
switched to db aux_www_devel
www-c:SECONDARY> db.web_exceptions.getIndexes()
[
	{
		"v" : 1,
		"key" : {
			"_id" : 1
		},
		"ns" : "aux_www_devel.web_exceptions",
		"name" : "_id_"
	}
]



 Comments   
Comment by Matt Dannenberg [ 12/Mar/14 ]

Unlike all other indexes, the _id index does not necessarily have unique: true. Instead it is tracked by an internal variable we cannot access called _isIdIndex which is set during index creation based upon whether or not the index spec matches the standard _id index (_id:1 or _id:-1).

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