Rafal,
> 10. I think the output of the test is nondeterministic (in the part
> testing PURGE ... BEFORE statement). If I'm correct, fix that.
It is deterministic. There are two things happening here. First, I am
using debug insertion to ensure the backup_id's are always the same. See
the "set_backup_id" in the code. Second, I am setting the start_time
ahead by 25+ hours using debug insertion. See the "set_start_time" in
the code (note: this has been renamed in the new patch). For example:
...
SELECT backup_id, start_time from mysql.backup_history;
backup_id start_time
500 2008-10-24 15:54:47
501 2008-10-24 15:54:47
502 2008-10-24 15:54:47
503 2008-10-25 19:41:28
504 2008-10-24 15:54:48
505 2008-10-24 15:54:48
506 2008-10-24 15:54:48
507 2008-10-25 19:41:28
SET @now_time= now();
SELECT @now_time;
@now_time
2008-10-24 15:54:51
PURGE BACKUP LOGS BEFORE @now_time;
SELECT backup_id, start_time from mysql.backup_history;
backup_id start_time
503 2008-10-25 19:41:28
507 2008-10-25 19:41:28
...
As you can see, the test is deterministic for both the backup_ids and
the datetime of start_time. Note: I added steps to ignore the timezone
in the test for added accuracy. Also, the real_sleep is needed to ensure
some time passes so that @now_time can be at least a few seconds greater
than the last insertion in the logs.
Thus, no matter what time the test is run, we are sure to get rows
inserted into the logs that have the exact backup_ids and we are
guaranteed that two very specific rows (backup_id 503 & 507) will have
start_time > @now.
> 11. Please test the error replies from PURGE BACKUP ... statements.
Do you mean all of the possible error messages from errmsg.txt or is
this something else?
> 12. I'd like to see a test checking what happens if PURGE BACKUP ... and
> BACKUP/RESTORE commands run in parallel.
Ok, but in a previous email I stated that it is possible to have a
situation where a PURGE BACKUP LOGS; command could remove part or all of
the information being written to the logs by the ongoing backup command
-- it just depends on what point the backup command is at when the purge
is issued. I will include one specific test to ensure the locks are
working properly, however.
Chuck