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

mongo shell should call getlasterror before terminating.

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Shell
    • None

    Description

      mongo shell should call getlasterror before terminating to confirm that any writes which have been performed have worked. the context here is when a script is given on the command line such as:

      ~/main $ ./mongo test.js

      and the script does some writes but not GLE call. you get a very fast return from the shell. the data is apt to get to the server still, if your client stays up because of so_linger, but seems non-ideal. also, the shell is returning before the work is done on the server. it might take an hour to finish yet the shell has returned which is not intuitive.

      When fixing this, we should think about w:majority or w:all – those might not be the right thing but to be considered. i could imagine calling getlasterror with w:1, waiting for that for sure, and then calling w:majority with a timeout and when timed out giving the user an fyi message at termination.

      Attachments

        Activity

          People

            backlog-server-platform DO NOT USE - Backlog - Platform Team
            dwight@mongodb.com Dwight Merriman
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: