[SERVER-7534] mongorestore incorrectly ignores w=1, the default Created: 01/Nov/12 Updated: 26/Oct/15 Resolved: 29/Nov/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Tools |
| Affects Version/s: | None |
| Fix Version/s: | 2.3.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | James Pharaoh | Assignee: | Shaun Verch |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Operating System: | ALL | ||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
Running mongorestore with no --w option, or using a version before it was introduced, works a lot faster than if I introduce --w 2. This feels wrong to me, the default behaviour, as per the docs, is to assume w=1: http://docs.mongodb.org/manual/reference/mongorestore/ Looking at the source code, I can see that the member variable _w is set to the --w argument, and that it defaults to 1. But the code is ignoring this if the value is one, for example: // wait for insert to propagate to "w" nodes (doesn't warn if w used without replset) The check should surely be if (_w > 0), the getLastError command still needs to run if w=1! The same happens in a few other places in the source code for mongorestore. I don't have time to play with this much more right now. We could simply fix it but it's going to slow things down. A better option would be to change the default to w=0 and update the documentation. |
| Comments |
| Comment by auto [ 29/Nov/12 ] |
|
Author: {u'date': u'2012-11-28T21:50:48Z', u'email': u'shaun.verch@10gen.com', u'name': u'Shaun Verch'}Message: |
| Comment by Ian Whalen (Inactive) [ 27/Nov/12 ] |
|
the default should be zero and the check should be if w>0. docs should also be updated. |