[SERVER-7319] mongo shell should call getlasterror before terminating. Created: 10/Oct/12  Updated: 12/May/17  Resolved: 12/May/17

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

Type: Improvement Priority: Major - P3
Reporter: Dwight Merriman Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-9294 Running a js script from Windows can ... Closed
Related
Participants:

 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.



 Comments   
Comment by Justin Cohler [ 12/May/17 ]

After the shell switched to using write commands rather than write ops, users should no longer see this behavior.

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