[SERVER-25019] Shell helpers should give users feedback during periods of long waits Created: 12/Jul/16  Updated: 06/Dec/22  Resolved: 17/Dec/21

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

Type: Task Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-24335 Shell sharding helpers should use wti... Closed
Assigned Teams:
Sharding
Participants:

 Description   

Several shell helpers make calls to the connected MongoDB instance that can block for long periods of time. Most notable is when we do writes to the config server with a majority write concern, though there are others. Where possible, in the case that these operations block for a while, rather than having the user just staring at a shell window that is hung and providing no feedback, it would be preferable if the user got periodic updates as to the status of the operation they are waiting on. For example:

mongos> sh.setBalancerState(false)
Disabling balancer...
No result after 5 secs, will keep trying for 55 secs...
No result after 10 secs, will keep trying for 50 secs...
No result after 15 secs, will keep trying for 45 secs...
No result after 20 secs, will keep trying for 40 secs...
No result after 25 secs, will keep trying for 35 secs...
No result after 30 secs, will keep trying for 30 secs...
No result after 35 secs, will keep trying for 25 secs...
No result after 40 secs, will keep trying for 20 secs...
No result after 45 secs, will keep trying for 15 secs...
No result after 50 secs, will keep trying for 10 secs...
No result after 55 secs, will keep trying for 5 secs...
ERROR: Unable to confirm that balancer has been disabled after 60 secs, please try again.

For the shell helpers that are performing writes with a write concern, this could be accomplished by using a low wtimeout for the first write, then using getLastError to periodically poll the status of the last write done. Shell helpers wrapping database commands with timeouts controlled in a different way may need more work to achieve this. Even if we can't do this for all the shell helpers, just getting the ones doing raw database writes would be a nice improvement.



 Comments   
Comment by Andy Schwerin [ 13/Jul/16 ]

I'm wary of using getLastError polling to achieve this behavior, but it's
an interesting possibility.

On Tue, Jul 12, 2016, 5:48 PM Spencer T Brody (JIRA) <jira@mongodb.org>

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