[mythtv-commits] Ticket #6300: Don't backup database if upgrade is not allowed
MythTV
mythtv at cvs.mythtv.org
Mon Feb 23 21:38:54 UTC 2009
#6300: Don't backup database if upgrade is not allowed
----------------------------------------------+-----------------------------
Reporter: sphery <mtdean at thirdcontact.com> | Owner: ijr
Type: patch | Status: new
Priority: minor | Milestone: unknown
Component: MythTV - General | Version: head
Severity: medium | Mlocked: 0
----------------------------------------------+-----------------------------
The attached patch ensures that we only backup the database if we are
allowed to upgrade the database. This will prevent mythfrontend from
attempting to perform a backup if it's not allowed to upgrade the DB.
I added a VERBOSE to prevent users from thinking that a failed backup is
causing the application to fail to start. The logged output when a client
is not allowed to upgrade the database (i.e. mythfrontend without the -u
/--upgrade-schema argument) will be:
{{{
2009-02-23 16:29:51.454 Current Schema Version: 1228
2009-02-23 16:29:51.454 Database schema is old. Waiting to see if DB is
being upgraded.
2009-02-23 16:29:52.454 New DB connection, total: 2
2009-02-23 16:29:52.455 Connected to database 'mythconverg' at host:
localhost
2009-02-23 16:29:52.457 Waiting for Database Backup to complete.
2009-02-23 16:29:53.458 Waiting for Database Backup to complete.
2009-02-23 16:29:54.460 Waiting for Database Backup to complete.
2009-02-23 16:29:55.461 Waiting for Database Backup to complete.
2009-02-23 16:29:56.463 Waiting for Database Backup to complete.
2009-02-23 16:29:57.464 Waiting for Database Backup to complete.
2009-02-23 16:29:57.464 Timed out waiting.
2009-02-23 16:29:57.465 Not allowed to upgrade the database. Skipping
backup.
2009-02-23 16:30:01.524 Couldn't upgrade database to new schema, exiting.
2009-02-23 16:30:01.524 Deleting UPnP client...
}}}
Without the new comment, "Not allowed to upgrade the database. Skipping
backup," the messages:
{{{
2009-02-23 16:29:57.464 Waiting for Database Backup to complete.
2009-02-23 16:29:57.464 Timed out waiting.
2009-02-23 16:30:01.524 Couldn't upgrade database to new schema, exiting.
}}}
would wrongly make it appear that the client (mythfrontend) attempted to
upgrade the database (versus waiting on someone else to do so) but failed
because the database backup did not complete.
Thanks to Otto K. for the suggestion.
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/6300>
MythTV <http://www.mythtv.org/>
MythTV
More information about the mythtv-commits
mailing list