Bug #40307 Backup: The list of databases processed by BACKUP/RESTORE not logged.
Submitted: 24 Oct 2008 14:01 Modified: 13 Dec 2008 17:50
Reporter: Rafal Somla Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Backup Severity:S4 (Feature request)
Version:6.0-backup OS:Any
Assigned to: Rafal Somla CPU Architecture:Any

[24 Oct 2008 14:01] Rafal Somla
Description:
At the beginning of BACKUP operation, note "Backup: Backing up selected 
databases" is put in the logs. But it does not inform about the databases being backed up and such information can be very useful. This is even more the case for the RESTORE operation when it might be important to see which databases are 
being affected by the operation. 

Compare this log (as reported now):

 [Note] Restore: Starting restore process
 [ERROR] Restore: Error when sending data (for table #1) to Default restore driver

with the following feedback:

 [Note] Restore: Starting restore process
 [Note] Restore: Restoring databases `db1`,`db2`,...
 [ERROR] Restore: Error when sending data (for table #1) to Default restore driver

In the latter case user can easily determine which databases might be affected by the aborted RESTORE operation.

Note 1: In the backup_history log, the list of affected databases can be inferred from the 'command' column.

Note 2: Fixing this will help solving BUG#35079 by providing better feedback in case of an interruption.

How to repeat:
Run any backup test and see the contents of var/log/master.err file.

Suggested fix:
At the beginning of BACKUP operation, when the list of databases to be backed up  is determined, log information:

 [Note] Backup: Backing up database(s) <list of databases being backed up>

At the beginning of RESTORE operation, after backup image's catalogue has been read, log information:

 [Note] Restore: Restoring database(s) <list of databases being restored>
[20 Nov 2008 9:36] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/59332

2736 Rafal Somla	2008-11-20
      BUG#40307 - Backup: The list of databases processed by BACKUP/RESTORE not 
                  logged.
      
      After this patch, the trace from BACKUP/RESTOE commands left in server's error 
      log (master.err) will look as follows:
      
       [Note] Backup: Starting backup process
       [Note] Backup: Backing up database(s) <list of databases>
       [Note] Backup: Backup completed
      
       [Note] Restore: Starting restore process
       [Note] Restore: Restoring database(s) <list of databases>
       [Note] Restore: Restore completed
      
      This way DBA can find out which databases are affected by the operation.
      
      Database list is reported in Logger::report_stats_pre() which is called after 
      initializing backup/restore catalogue and before performing backup of table 
      data.
[25 Nov 2008 19:36] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/59842

2747 Rafal Somla	2008-11-25
      BUG#40307 - Backup: The list of databases processed by BACKUP/RESTORE not 
                  logged.
      
      After this patch, the trace from BACKUP/RESTOE commands left in server's error 
      log (master.err) will look as follows:
      
       [Note] Backup: Starting backup process
       [Note] Backup: Backing up NN database(s) <list of databases>
       [Note] Backup: Backup completed
      
       [Note] Restore: Starting restore process
       [Note] Restore: Restoring NN database(s) <list of databases>
       [Note] Restore: Restore completed
      
      This way DBA can find out which databases are affected by the operation.
      
      Database list is reported in Logger::report_stats_pre() which is called after 
      initializing backup/restore catalogue and before performing backup of table 
      data.
[26 Nov 2008 10:44] Jørgen Løland
Good to push
[26 Nov 2008 14:53] Øystein Grøvlen
Patch approved.
[28 Nov 2008 9:12] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/60127

2736 Rafal Somla	2008-11-28
      BUG#40307 - Backup: The list of databases processed by BACKUP/RESTORE not 
                  logged.
      
      After this patch, the trace from BACKUP/RESTOE commands left in server's error 
      log (master.err) will look as follows:
      
       [Note] Backup: Starting backup process
       [Note] Backup: Backing up NN database(s) <list of databases>
       [Note] Backup: Backup completed
      
       [Note] Restore: Starting restore process
       [Note] Restore: Restoring NN database(s) <list of databases>
       [Note] Restore: Restore completed
      
      This way DBA can find out which databases are affected by the operation.
      
      Database list is reported in Logger::report_stats_pre() which is called after 
      initializing backup/restore catalogue and before performing backup of table 
      data.
[28 Nov 2008 10:11] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/60135

2736 Rafal Somla	2008-11-28
      BUG#40307 - Backup: The list of databases processed by BACKUP/RESTORE not 
                  logged.
      
      After this patch, the trace from BACKUP/RESTOE commands left in server's error 
      log (master.err) will look as follows:
      
       [Note] Backup: Starting backup process
       [Note] Backup: Backing up NN database(s) <list of databases>
       [Note] Backup: Backup completed
      
       [Note] Restore: Starting restore process
       [Note] Restore: Restoring NN database(s) <list of databases>
       [Note] Restore: Restore completed
      
      This way DBA can find out which databases are affected by the operation.
      
      Database list is reported in Logger::report_stats_pre() which is called after 
      initializing backup/restore catalogue and before performing backup of table 
      data.
[28 Nov 2008 12:48] Rafal Somla
Pushed into 6.0-backup tree on Fri Nov 28 10:18:28 2008.
[12 Dec 2008 6:25] Bugs System
Pushed into 6.0.9-alpha  (revid:rafal.somla@sun.com-20081128101039-5zz03fq2qmg63h0v) (version source revid:jorgen.loland@sun.com-20081128103522-v3wlnmc52j76baqa) (pib:5)
[13 Dec 2008 17:50] Paul Dubois
Noted in 6.0.9 changelog.

BACKUP DATABASE and RESTORE now indicate in the server's error log
which databases are being backed up or restored.