Juju backup fails when journal files are present

Bug #1423936 reported by Jorge Niedbalski on 2015-02-20
6
This bug affects 1 person
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:linux-image-3.13.0-36-generic
juju-mongodb:2.4.9-0ubuntu3
juju-core:1.20.8-0ubuntu1~14.04.1~juju1
juju-agent-version:1.20.8.1

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.....SUCCESS

**************************************************************
Backing up mongo database
**************************************************************
Stopping mongo.....SUCCESS
Backing up mongo.....FAILED
------------------------------------------------------------
Command failed: /usr/lib/juju/bin/mongodump --dbpath /var/lib/juju/db
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.maas-cl201-std-nec.com closed.

My understanding is that '--journal' should be passed to mongodump because is relevant
if dbpath is specified.

tags: added: cts
Curtis Hovey (sinzui) on 2015-02-24
tags: added: backup-restore
Changed in juju-core:
status: New → Triaged
importance: Undecided → Medium
Eric Snow (ericsnowcurrently) wrote :

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.

Eric Snow (ericsnowcurrently) wrote :

@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
Eric Snow (ericsnowcurrently) wrote :

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 :

As niedbalski just pointed out to me, it doesn't hurt.

Ian Booth (wallyworld) on 2015-03-24
Changed in juju-core:
milestone: none → 1.24-alpha1
Curtis Hovey (sinzui) on 2015-04-07
Changed in juju-core:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers