STATUS
------
Not approved.
REQUIRED
--------
1. Fix test failure.
REQUESTS
--------
2. Fix minor documentation errors.
DETAILS
-------
> Bug #43322 - Finish time of BACKUP operation not stored in backup image
[2] Please restate the problem here. I think we need more explanation of what
the problem was (why mainly) and then how this patch fixes it.
>
> Fixed by ensuring that:
>
> 1) End time of backup operation is stored in Backup_info *before* backup image
> summary is written.
>
> 2) The times stored in backup image's summary and logged in backup logs are
> the
> same.
> @ mysql-test/suite/backup/t/backup_logs.test
> Added new test for checking that times stored in backup logs and in
> backup image's summary section are the same.
[2] I am going to be picky here. It isn't a new test you are adding. As Ingo
has pointed out, what you are adding is a test case to a test file. Please
change comment accordingly.
> @ sql/backup/image_info.h
> Add get_end_time() method. Move code common to get_*_time() to new
> helper function read_time() - a counterpart of save_time().
> @ sql/backup/kernel.cc
> - When end of backup/restore operation is reported in Backup_info::close()
> use
> the end time saved in the Backup_info structure. If the end time was not
> saved
> before, save and use the current time.
> - Save end time after backup of table data is complete and before the summary
>
> section is written.
...
> === modified file 'mysql-test/suite/backup/r/backup_logs.result'
> --- a/mysql-test/suite/backup/r/backup_logs.result 2009-05-25 07:11:29 +0000
> +++ b/mysql-test/suite/backup/r/backup_logs.result 2009-07-15 06:42:39 +0000
> @@ -230,6 +230,21 @@ timediff(stop_time, validity_point_time)
> from mysql.backup_history WHERE backup_id=500;
> timediff(validity_point_time, start_time) >= 0 timediff(stop_time,
> validity_point_time) >=0
> 1 1
> +Now verify that times from the log are the same as the ones stored in the image.
> +CREATE TABLE summary (header text, value datetime);
> +LOAD DATA INFILE
> '/ext/mysql/bzr/backup/bug43322/mysql-test/var/mysqld.1/data//backup_logs_orig.summary'
> + INTO TABLE summary
> +FIELDS TERMINATED BY 'time:';
> +SELECT value FROM summary WHERE header like 'Creation%' LIMIT 1 INTO
> @summary_start;
> +SELECT value FROM summary WHERE header like 'Finish%' INTO @summary_stop;
> +SELECT value FROM summary WHERE header like 'Validity%' INTO @summary_vp;
> +DROP TABLE summary;
> +SELECT start_time = @summary_start,
> +stop_time = @summary_stop,
> +validity_point_time = @summary_vp
> +FROM mysql.backup_history WHERE backup_id= 500;
> +start_time = @summary_start stop_time = @summary_stop validity_point_time =
> @summary_vp
> +1 1 1
[1] I get errors on this test:
CURRENT_TEST: backup.backup_logs
---
/home/cbell/source/bzr/mysql-6.0-review/mysql-test/suite/backup/r/backup_logs.result
2009-07-15 18:08:07.000000000 +0300
+++
/home/cbell/source/bzr/mysql-6.0-review/mysql-test/suite/backup/r/backup_logs.reject
2009-07-15 20:24:38.000000000 +0300
@@ -232,7 +232,7 @@
1 1
Now verify that times from the log are the same as the ones stored in the image.
CREATE TABLE summary (header text, value datetime);
-LOAD DATA INFILE
'/ext/mysql/bzr/backup/bug43322/mysql-test/var/mysqld.1/data//backup_logs_orig.summary'
+LOAD DATA INFILE
'/home/cbell/source/bzr/mysql-6.0-review/mysql-test/var/mysqld.1/data//backup_logs_orig.summary'
INTO TABLE summary
FIELDS TERMINATED BY 'time:';
SELECT value FROM summary WHERE header like 'Creation%' LIMIT 1 INTO
@summary_start;
mysqltest: Result content mismatch
> === modified file 'mysql-test/suite/backup/t/backup_logs.test'
> --- a/mysql-test/suite/backup/t/backup_logs.test 2009-05-25 07:11:29 +0000
> +++ b/mysql-test/suite/backup/t/backup_logs.test 2009-07-15 06:42:39 +0000
> @@ -318,6 +318,35 @@ SELECT timediff(validity_point_time, sta
> timediff(stop_time, validity_point_time) >=0
> from mysql.backup_history WHERE backup_id=500;
>
> +
> +--echo Now verify that times from the log are the same as the ones stored in the
> image.
> +
> +# Use mysqlbackup utility to read the summary of the backup image.
> +exec $MYSQL_BACKUP --summary $MYSQLD_BACKUPDIR/backup_logs_orig.bak
> >$MYSQLD_DATADIR/backup_logs_orig.summary;
> +
> +# Create a table and load output of mysqlbackup into it to access the data.
> +CREATE TABLE summary (header text, value datetime);
> +--disable_warnings
> +eval LOAD DATA INFILE '$MYSQLD_DATADIR/backup_logs_orig.summary'
> + INTO TABLE summary
> + FIELDS TERMINATED BY 'time:';
> +--enable_warnings
> +--remove_file $MYSQLD_DATADIR/backup_logs_orig.summary
[1] I think you need to either mask out the $MYSQLD_DATADIR or use
disable/enable to turn the query log off then on again -- see loaddata.test for
an example.
...
Chuck