[SERVER-10230] Shouldn't be possible to create indexes on system.namespaces Created: 16/Jul/13  Updated: 11/Jul/16  Resolved: 24/Sep/14

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

Type: Bug Priority: Major - P3
Reporter: Mathias Stearn Assignee: hari.khalsa@10gen.com
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-10231 Creating an index on system.indexes b... Closed
Operating System: ALL
Participants:

 Description   

> use breakMyDb
switched to db breakMyDb
> db.system.namespaces.ensureIndex({_id:1}, {unique:true})
> db.foo.insert({})
E11000 duplicate key error index: breakMyDb.system.namespaces.$_id_  dup key: { : null }



 Comments   
Comment by Asya Kamsky [ 24/Sep/14 ]

2.6.x does not allow system.namespaces or system.index indexes to be created.

Comment by Asya Kamsky [ 24/Sep/14 ]

This issue applies to 2.4.x and earlier as 2.6.x does not allow creating indexes on system collections.

(2.6.5-rc2-pre) > db.system.namespaces.ensureIndex({name:1})
{
	"ok" : 0,
	"errmsg" : "cannot write to 'dataTest.system.namespaces'",
	"code" : 2
}
appdataTest@local(2.6.5-rc2-pre-) > db.system.indexes.ensureIndex({name:1})
{
	"ok" : 0,
	"errmsg" : "cannot create indexes on the system.indexes collection",
	"code" : 67
}

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