Bug #59673 Failed backup operations are not logged in backup_history table
Submitted: 22 Jan 2011 3:08 Modified: 28 Feb 2011 23:10
Reporter: Hema Sridharan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Enterprise Backup Severity:S3 (Non-critical)
Version:MEB 3.6 OS:Any
Assigned to: Thava Alagu CPU Architecture:Any
Tags: regression
Triage: Needs Triage: D3 (Medium)

[22 Jan 2011 3:08] Hema Sridharan
Description:
Perform negative testing by giving wrong options when executing the command and ensure that mysqlbackup fails.
Verify that this failed operation is logged properly in the backup_history tables with appropriate exit_state and last_error values.

Pull the latest version of meb from the patch below and follow the compilation instructions from the README file.
bzr+ssh://bk-internal.mysql.com/bzrroot/meb/sbin-repo/single-bin/ 

How to repeat:
Test if failure is logged with wrong order of arguments.
Do not pass --lsn option with --incremental  option. The test fails with error number 1 but this is not logged in history logs. The exit_state and last_error fields are shown blank

--exec $MYSQLBACKUP --port=$MASTER_MYPORT  --protocol=tcp --user=root  --incremental --backup-dir=$BACKUP_TARGET_DIR  backup > $BACKUP_LOG 2>&1

SELECT exit_state,last_error FROM mysql.backup_history

Suggested fix:
Ideally even failed operations should be logged in backup_history tables similar to MEB 3.5.2 version.
[5 Feb 2011 13:09] Sveta Smirnova
Thank you for the report.

Verified as described.
[7 Feb 2011 23:02] Thava Alagu
This must have been fixed in the latest code. Please verify and close the bug if that is the case. thanks.
[9 Feb 2011 22:42] Hema Sridharan
Thava,

The failed backup operations are still not logged in the history_table. It is logged in the progress table but not in backup_history. 

Example: I executed backup once to /tmp/mebdir and then tried the same with out deleting the directory. MEB fails giving an error as
"Backup directory already exists and is not empty.
  Please remove backup directory and retry."

Check the mysql.backup_history table, it will show the data for only the successful backup operation and not the failed.In such case, I am not willing to close the bug.
[16 Feb 2011 9:47] Thava Alagu
It is by design that command line syntax error and basic configuration errors are not logged as failures in history logs, these are too premature errors. Other errors should be logged. Please check with the latest patch and see if you still see any issues.
[28 Feb 2011 23:01] Hema Sridharan
I expected that premature errors will also be logged in the backup history table. But if it is not by design, then it better to close the bug report. Other major errors are reported in progress and history tables.