Juju backup fails when journal files are present
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | juju-core |
Medium
|
Jorge Niedbalski | ||
| | 1.22 |
High
|
Jorge Niedbalski | ||
| | 1.23 |
High
|
Eric Snow | ||
Bug Description
[Environment]
Versions in use:
OS:Ubuntu 14.04.1 LTS
Kernel:
juju-mongodb:
juju-core:
juju-agent-
I think this also affects juju-core 1.21 and others.
[Details]
When performing a juju backup on an installation where the state-server machine that has been restarted/crashed
journal files are created on the database. MongoDB uses write ahead logging to an on-disk journal to guarantee write operation durability and to provide crash resiliency. Actually, juju mongod instance runs with explicit '--journal' option available.
If the specified dbpath has journal files , then the juju backup fails as demonstrated in the following lines:
*******
Making backup directory.
*******
Backing up mongo database
*******
Stopping mongo.....SUCCESS
Backing up mongo.....FAILED
-------
Command failed: /usr/lib/
Error: **************
Error: journal files are present in journal directory, yet starting without journaling enabled.
It is recommended that you start with journaling enabled so that recovery may occur.
**************
If you are running a mongod on the same path you should connect to that instead of direct data file access
Fri Feb 20 12:00:15.676 dbexit:
Fri Feb 20 12:00:15.676 [tools] shutdown: going to close listening sockets...
Fri Feb 20 12:00:15.676 [tools] shutdown: going to flush diaglog...
Fri Feb 20 12:00:15.676 [tools] shutdown: going to close sockets...
Fri Feb 20 12:00:15.677 [tools] shutdown: waiting for fs preallocator...
Fri Feb 20 12:00:15.677 [tools] shutdown: closing all files...
Fri Feb 20 12:00:15.677 [tools] closeAllFiles() finished
Fri Feb 20 12:00:15.677 [tools] shutdown: removing fs lock...
Fri Feb 20 12:00:15.677 dbexit: really exiting now
-------
juju-db start/running, process 26187
Connection to gd2bsbp001.
My understanding is that '--journal' should be passed to mongodump because is relevant
if dbpath is specified.
| tags: | added: cts |
| tags: | added: backup-restore |
| Changed in juju-core: | |
| status: | New → Triaged |
| importance: | Undecided → Medium |
| Eric Snow (ericsnowcurrently) wrote : | #1 |
| Eric Snow (ericsnowcurrently) wrote : | #2 |
@Jorge: Also please link to the PR and/or review request here.
| Changed in juju-core: | |
| assignee: | nobody → Jorge Niedbalski (niedbalski) |
| Changed in juju-core: | |
| status: | Triaged → Fix Committed |
| Jorge Niedbalski (niedbalski) wrote : | #3 |
| Eric Snow (ericsnowcurrently) wrote : | #4 |
I just realized, we should not be passing --journal to the new restore (in 1.22 and later) since we don't also pass --dbpath. The fix to the plugin is correct though.
| Eric Snow (ericsnowcurrently) wrote : | #5 |
As niedbalski just pointed out to me, it doesn't hurt.
| Changed in juju-core: | |
| milestone: | none → 1.24-alpha1 |
| Eric Snow (ericsnowcurrently) wrote : | #6 |
For 1.23: https:/
| Changed in juju-core: | |
| status: | Fix Committed → Fix Released |


Hmm. I a bit surprised we weren't passing the --journal option already to both mongodump and mongorestore. Thanks for catching this and writing a patch.