[SERVER-20915] Resolve shell readMode on connection open Created: 14/Oct/15 Updated: 07/Jun/23 Resolved: 07/Jun/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | 3.1.9 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Kevin Pulo | Assignee: | [DO NOT ASSIGN] Backlog - Server Development Platform Team (SDP) (Inactive) |
| Resolution: | Done | Votes: | 2 |
| Labels: | move-stm, sdp-backlog-purge | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Assigned Teams: |
Server Development Platform
|
||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||
| Sprint: | Build B (10/30/15), Build C (11/20/15) | ||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||
| Description |
|
Transcript below edited to show keystrokes. Of course, it's only when connected to an older mongod/mongos, and only the first time tab is used.
|
| Comments |
| Comment by David Storch [ 07/Jun/23 ] | |||||||
|
I don't think this ticket is relevant anymore. First of all, we deprecated legacy OP_QUERY find in 5.0 and removed support for it in 5.1. We also stopped supporting the mongo shell externally, so we only really need to maintain it as an internal testing tool. Also, I recently implemented Closing as "Gone Away". | |||||||
| Comment by Steven Vannelli [ 10/May/22 ] | |||||||
|
Moving this ticket to the Backlog and removing the "Backlog" fixVersion as per our latest policy for using fixVersions. | |||||||
| Comment by David Storch [ 21/Oct/15 ] | |||||||
|
After discussing with jason.rassi and jbreams, we decided that the best thing to do is to cache the readMode and writeMode on connection open. Right now we lazily infer the mode when the first write or read happens, which means that a warning message is delayed until you happen to run a particular operation. This also fixes the tab-completion usability problem without having to remove potentially useful warnings. | |||||||
| Comment by Kevin Pulo [ 20/Oct/15 ] | |||||||
|
There's a corresponding write mode degradation message, which has been there since write commands were introduced in 2.6. The only real difference is that it doesn't trigger during tab completion (since hitting tab never causes a write).
If we drop the message for read mode (but not write mode) then they will be inconsistent, which may surprise/catch some users. Should the write mode message also be removed? If we do remove these, can we make it a little easier to discover the read/write mode that the shell is using? I think db.getReadMode() and db.getWriteMode() as thin wrappers around db.getMongo().readMode() and db.getMongo().writeMode() would help. | |||||||
| Comment by David Storch [ 20/Oct/15 ] | |||||||
|
jbreams, I think we can probably just remove it. That message is simply informational: a user might want to know if they are running a new shell against an old server in a way that is affecting the read protocol. On the other hand, you could argue that unless you are explicitly passing readMode "commands" or readMode "legacy", you shouldn't care about how the shell and server are negotiating the read protocol. So I'd say let's remove it. | |||||||
| Comment by Jonathan Reams [ 20/Oct/15 ] | |||||||
|
david.storch, is this message even necessary at all? Is there something the user can do in response to degrading to legacy mode besides quitting? Maybe we should just remove this message altogether. | |||||||
| Comment by Kevin Pulo [ 15/Oct/15 ] | |||||||
|
Correct, the fundamental problem here is the printing during line editing. That the print includes a newline (you can't print without newline in the shell anyway) means this isn't too bad (compared to if there was no newline). But it's unexpectedly jarring. I'm not sure what the fix should be. Just suppressing the notice would fix it, but presumably we still want it at other times. Suppressing it only during tab completion would also work, except then if it gets triggered by tab completion the the user will get no notification, which is different to the behaviour if the Tab key isn't used. Perhaps the best solution will be to suppress during tab completion both the notification and the remembering of the readMode degradation. This would stop the notice during tab completion, but still let it occur the first time it's encountered "normally", at the cost of repeatedly checking the wire version until that happens. | |||||||
| Comment by Scott Hernandez (Inactive) [ 14/Oct/15 ] | |||||||
|
What behavior do you suggest? What is the bug here, printing on the same line as tab completing? |