[SERVER-2305] Mongo locks should be purged (or at least ignored) when the server is started cold (while not currently running) Created: 29/Dec/10 Updated: 29/Dec/10 Resolved: 29/Dec/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | phpMoAdmin | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Participants: |
| Description |
|
A server had a failure in the middle of the night that caused a hard-reboot (nothing to do with Mongo) but then after boot the MongoDB service never started up again (turning the 1-minute of downtime into most of the night until a human would intervene.) The issue was that the Mongo server would not start up unless all locks are cleared, this was in the log:
This seems great if you are restarting and really bad for a fresh-start when Mongo is not currently running. My startup script now has a clause for: But this is a hack - the Mongo server should just ignore the locks and start-up if there is no server currently active. |
| Comments |
| Comment by Eliot Horowitz (Inactive) [ 29/Dec/10 ] |
|
repair can take seconds to days depending on data size and setup, so its not something that we can always do all the time. |
| Comment by phpMoAdmin [ 29/Dec/10 ] |
|
So my hack to mv the lock file should be replaced with: Is that right? Is there any harm in always running this before Mongo-start (instead of specifically when a crash occurred)? Also, when 1.8 becomes a production-stable version and I upgrade, at that point I would simply remove that --repair line from the startup script, right? Is there a reason why this would not be backported to the current stable 1.6.5? It seems simple (at least in theory) to add to the mongod startup: Clearly my issue is user-error, but it is not really obvious that Mongo won't start up again after an unclean shutdown - I would bet that the majority of users will experience the server failing to restart at least once before learning that they need to do the --repair first. |
| Comment by Eliot Horowitz (Inactive) [ 29/Dec/10 ] |
|
This is actually exactly what is supposed to happen. After a crash, you have to run --repair, which is why it won't start up with a lock file. With single server durability in 1.8, --repair won'e be needed so this will be automatic. |