[SERVER-47840] Don't write "hidden: false" to the index catalog when createIndexes specifies it explicitly Created: 29/Apr/20  Updated: 29/Oct/23  Resolved: 06/May/20

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: None
Fix Version/s: 4.4.0-rc5, 4.7.0

Type: Bug Priority: Major - P3
Reporter: James Wahlin Assignee: Ruoxin Xu
Resolution: Fixed Votes: 0
Labels: qexec-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Minor Change
Operating System: ALL
Backport Requested:
v4.4
Steps To Reproduce:

> 
> db.runCommand({createIndexes: "test", indexes: [{key: {y: 1}, name: "y", hidden: false}]})
{
	"createdCollectionAutomatically" : true,
	"numIndexesBefore" : 1,
	"numIndexesAfter" : 2,
	"ok" : 1
}
> db.runCommand({listIndexes: "test"})
{
	"cursor" : {
		"id" : NumberLong(0),
		"ns" : "test.test",
		"firstBatch" : [
			{
				"v" : 2,
				"key" : {
					"_id" : 1
				},
				"name" : "_id_"
			},
			{
				"v" : 2,
				"key" : {
					"y" : 1
				},
				"name" : "y",
				"hidden" : false
			}
		]
	},
	"ok" : 1
}
>

Sprint: Query 2020-05-18
Participants:

 Description   

If an index is created with the index spec attribute "hidden: false" it should be accepted but not written to the index catalog. Omitting the field is equivalent and will allow MongoDB server versions <= 4.2 to load the catalog.



 Comments   
Comment by Githook User [ 08/May/20 ]

Author:

{'name': 'Ruoxin Xu', 'email': 'ruoxin.xu@mongodb.com', 'username': 'RuoxinXu'}

Message: SERVER-47840 Do not write "hidden: false" to the index catalog when createIndexes specifies it explicitly

(cherry picked from commit bae19fea072ed8a8bc46db8f787b5474fbbc5f7b)
Branch: v4.4
https://github.com/mongodb/mongo/commit/4e2e19c2c2bcc484627142655c4ba43db86f5afc

Comment by Githook User [ 05/May/20 ]

Author:

{'name': 'Ruoxin Xu', 'email': 'ruoxin.xu@mongodb.com', 'username': 'RuoxinXu'}

Message: SERVER-47840 Do not write "hidden: false" to the index catalog when createIndexes specifies it explicitly
Branch: master
https://github.com/mongodb/mongo/commit/bae19fea072ed8a8bc46db8f787b5474fbbc5f7b

Generated at Thu Feb 08 05:15:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.