-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 3.4.4, 3.5.7
-
Component/s: Internal Code
-
None
-
Fully Compatible
-
ALL
-
v3.4
-
Platforms 2017-05-29
-
0
After creating a user on 3.2, running getIndexes shows indexes created on admin.system.users.
> db.system.users.getIndexes() [ ] > db.createUser({user: "sajack", pwd: "sajack", roles: []}) Successfully added user: { "user" : "sajack", "roles" : [ ] } > db.system.users.getIndexes() [ { "v" : 1, "key" : { "_id" : 1 }, "name" : "_id_", "ns" : "admin.system.users" }, { "v" : 1, "unique" : true, "key" : { "user" : 1, "db" : 1 }, "name" : "user_1_db_1", "ns" : "admin.system.users" } ]
Performing the same operation on 3.4 does not result in an index being created:
> use admin switched to db admin > db.createUser({user: "sajack", pwd: "sajack", roles: []}) Successfully added user: { "user" : "sajack", "roles" : [ ] } > db.system.users.getIndexes() [ { "v" : 2, "key" : { "_id" : 1 }, "name" : "_id_", "ns" : "admin.system.users" } ]
This could cause authentication to be slow.
This seems to be caused in auth_index_d.cpp. This call requires the index version be explicitly set to 2:
collection->getIndexCatalog()->createIndexOnEmptyCollection( opCtx, BSON("name" << v3SystemUsersIndexName << "ns" << collection->ns().ns() << "key" << v3SystemUsersKeyPattern << "unique" << true));
- related to
-
SERVER-33089 Unable to start queryable mongod because it failed to regenerate index for admin.system.users
- Closed
-
SERVER-29623 Fix system_authorization_indexes.js on inMemory storage engine
- Closed