[SERVER-34244] listCollections should support a nameOnly option Created: 30/Mar/18  Updated: 29/Oct/23  Resolved: 11/Apr/18

Status: Closed
Project: Core Server
Component/s: Catalog, Storage
Affects Version/s: None
Fix Version/s: 3.7.4

Type: Task Priority: Major - P3
Reporter: Geert Bosch Assignee: Xiangyu Yao (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Documented
is documented by DOCS-11593 Docs for SERVER-34244: listCollection... Closed
Related
Backwards Compatibility: Fully Compatible
Sprint: Storage NYC 2018-04-23
Participants:
Linked BF Score: 0

 Description   

Currently the listCollections command needs to lock all collections to return their information. However, often only names are necessary. So, improve the listCollections command to support a nameOnly option like listDatabases and only require a MODE_IS lock on the database for that command.



 Comments   
Comment by Githook User [ 12/Apr/18 ]

Author:

{'email': 'xiangyu.yao@mongodb.com', 'name': 'Xiangyu Yao', 'username': 'xy24'}

Message: SERVER-34244 Fix list_collections_name_only.js
Branch: master
https://github.com/mongodb/mongo/commit/5509e913aa867404a72417b961ed318ca32b1841

Comment by Githook User [ 11/Apr/18 ]

Author:

{'email': 'xiangyu.yao@mongodb.com', 'name': 'Xiangyu Yao', 'username': 'xy24'}

Message: SERVER-34244 Add nameOnly option to listCollections
Branch: master
https://github.com/mongodb/mongo/commit/c4b86320d1655046221144644a8d801b6a435e15

Comment by Xiangyu Yao (Inactive) [ 11/Apr/18 ]

pasette, I just had a quick try and found the change worked for show tables and show collections.They all use the getCollectionNames helper I made change to. I am going to take another look at other internal clients of listCollections that only require the name.

Comment by Daniel Pasette (Inactive) [ 11/Apr/18 ]

geert.bosch, is the plan here to plumb this into the show tables and show collections shell helpers as well? IIRC, one of the goals of this work was to avoid blocking while a txn is in progress, but if it's not hooked up, this work won't help. Are there other internal clients of listCollections that only require the name?

Comment by Ian Whalen (Inactive) [ 06/Apr/18 ]

Ack. geert.bosch and milkie should this get assigned out now since it sounds like we'll want it for 3.7.4 feature complete?

Comment by Bernie Hackett [ 06/Apr/18 ]

Just something drivers would have to add support for. The work is likely minor.

Comment by Ian Whalen (Inactive) [ 06/Apr/18 ]

Putting in 3.7.4 under the assumption there is Drivers impact here. behackett can you confirm if that's true so we can bump out a bit if not?

Generated at Thu Feb 08 04:36:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.