Opened 11 years ago

Closed 11 years ago

#6300 closed patch (fixed)

Don't backup database if upgrade is not allowed

Reported by: sphery <mtdean@…> Owned by: paulh
Priority: minor Milestone: 0.22
Component: MythTV - General Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

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.

Attachments (1)

mythtv-6300-only_backup_DB_if_upgradeallowed.patch (728 bytes) - added by sphery <mtdean@…> 11 years ago.

Download all attachments as: .zip

Change History (3)

Changed 11 years ago by sphery <mtdean@…>

comment:1 Changed 11 years ago by paulh

Milestone: unknown0.22
Owner: changed from Isaac Richards to paulh
Status: newassigned

comment:2 Changed 11 years ago by paulh

Resolution: fixed
Status: assignedclosed

(In [20060]) Don't bother backing up the database if we cannot upgrade it. Patch from Sphery. Closes #6300.

Note: See TracTickets for help on using tickets.