Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-25019

Shell helpers should give users feedback during periods of long waits



    • Type: Task
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: Shell
    • Labels:


      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.


          Issue Links



              backlog-server-sharding Backlog - Sharding Team
              spencer Spencer Brody (Inactive)
              0 Vote for this issue
              5 Start watching this issue