[SERVER-35638] Shell auto-completion blocks when listCollection is waiting for locks Created: 16/Jun/18  Updated: 29/Oct/23  Resolved: 26/Apr/19

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: 4.1.11

Type: Bug Priority: Major - P3
Reporter: Siyuan Zhou Assignee: A. Jesse Jiryu Davis
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Problem/Incident
Related
related to SERVER-41118 Have autocomplete.js handle slow list... Closed
related to SERVER-32942 mongo shell: for users authorized to ... Closed
related to SERVER-36262 mongo shell: allow users to show dbs ... Closed
Operating System: ALL
Backport Requested:
v4.0
Sprint: Service Arch 2019-04-22
Participants:
Linked BF Score: 6

 Description   

Auto-completion after `db.` sends a listCollection to the server, which may be blocked on locks. In 4.0, the lifespan of a lock could be much longer than before due to transactions. When a 'dropDatabase' is waiting on the global lock in X mode which is acquired by an inactive transaction in IX mode, listCollection will be blocked. The behavior is expected, but when a user notices the blocking dropDatabase and wants to inspect and kill the current operation, the user cannot use auto-completion. Otherwise, the shell hangs after the <tab>

> db.cur<tab>

Using maxTimeMS with listCommand could fix the usability issue.



 Comments   
Comment by Githook User [ 26/Apr/19 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis', 'email': 'jesse@mongodb.com'}

Message: SERVER-35638 Short timeout to autocomplete collection names

Also resolves SERVER-40736, test autocompletion of collection names for users
without the listCollections permission.
Branch: master
https://github.com/mongodb/mongo/commit/b6cc1fb89f8fbf92c66ef6274a1de1ad310b2fb1

Comment by Githook User [ 24/Apr/19 ]

Author:

{'email': 'justin.seyster@mongodb.com', 'name': 'Justin Seyster', 'username': 'jseyster'}

Message: Revert "SERVER-35638 Short timeout to autocomplete collection names"

This reverts commit f202c4c1ba24b9f561e8b11dac5b04fa0eeb4919.
Branch: master
https://github.com/mongodb/mongo/commit/0e9dcfbff4846e848b82e9c99f0d950dd7eaeae1

Comment by Githook User [ 24/Apr/19 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis', 'email': 'jesse@mongodb.com'}

Message: SERVER-35638 Short timeout to autocomplete collection names

Also resolves SERVER-40736, test autocompletion of collection names for users
without the listCollections permission.
Branch: master
https://github.com/mongodb/mongo/commit/f202c4c1ba24b9f561e8b11dac5b04fa0eeb4919

Comment by A. Jesse Jiryu Davis [ 19/Apr/19 ]

alyson.cabral see SERVER-40736.

Comment by Alyson Cabral (Inactive) [ 19/Apr/19 ]

I think doing this ticket is valuable. But yes, I think we should also open another ticket.

Comment by A. Jesse Jiryu Davis [ 17/Apr/19 ]

alyson.cabral I'm just reading this ticket for the first time. Can you explain what the list collections privilege has to do with this ticket? I thought this ticket's issue was concerned with transactions blocking listCollections, but not anything to do with privileges. Are you suggesting we should open a separate ticket? That ticket would be to enable, for auto-completion, the same privilege workaround we implemented for "show dbs" and "show collections".

Comment by Alyson Cabral (Inactive) [ 23/Jan/19 ]

Many users in atlas do not have the list collections privilege. I'm more interested in getting this to work for all of our users in the same way we got show dbs and show collections working.

Comment by Gregory McKeon (Inactive) [ 18/Jun/18 ]

Assigning this to neweng to determine if we can just fix this with maxtimems.

Comment by Siyuan Zhou [ 16/Jun/18 ]

CC'ing max.hirschhorn for the shell issue.

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