[SERVER-12513] Opening 2.6 DB with 2.4 creates unique index on admin.system.users Created: 28/Jan/14  Updated: 11/Jul/16  Resolved: 07/Feb/14

Status: Closed
Project: Core Server
Component/s: Security
Affects Version/s: 2.5.4
Fix Version/s: 2.6.0-rc0

Type: Bug Priority: Major - P3
Reporter: Andreas Nilsson Assignee: Spencer Brody (Inactive)
Resolution: Done Votes: 0
Labels: 26qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

> use admin
> db.system.users.find()
> db.createUser({user:"user",pwd:"pwd",roles:[]})
Successfully added user: { "user" : "user", "roles" : [ ] }
> use test
switched to db test
> db.createUser({user:"user",pwd:"pwd",roles:[]})
2014-01-28T14:21:51.423-0500 Error: couldn't add user: User "user@test" already exists at src/mongo/shell/db.js:1004

Participants:

 Description   

Opening a 2.6 DB with 2.4 creates a unique index on the admin.system.users collection that prevents adding multiple users with the same name to different DBs when reopening in 2.6.

{ "v" : 1, "key" : { "user" : 1, "userSource" : 1 }, "unique" : true, "ns" : "admin.system.users", "name" : "user_1_userSource_1" }

This could be fixed by automatically deleting such an index if the user doc version is >= 3.



 Comments   
Comment by Githook User [ 07/Feb/14 ]

Author:

{u'username': u'stbrody', u'name': u'Spencer T Brody', u'email': u'spencer@mongodb.com'}

Message: SERVER-12513 At startup, if a 2.4-style index on admin.system.users is detected, remove it
Branch: master
https://github.com/mongodb/mongo/commit/749126d5ea0f59828c370880f1b3fba3395015d5

Comment by Githook User [ 30/Jan/14 ]

Author:

{u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'}

Message: Revert "SERVER-12513 If a 2.4-style index on admin.system.users is detected, remove it"

This reverts commit 36c3d951c28cf752789cf881089f3a1683974ac8.
Branch: master
https://github.com/mongodb/mongo/commit/6a96bab90ebf69d5df1ca120e31599933c910a89

Comment by Githook User [ 30/Jan/14 ]

Author:

{u'username': u'stbrody', u'name': u'Spencer T Brody', u'email': u'spencer@mongodb.com'}

Message: SERVER-12513 If a 2.4-style index on admin.system.users is detected, remove it
Branch: master
https://github.com/mongodb/mongo/commit/36c3d951c28cf752789cf881089f3a1683974ac8

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