Bug #1357 MySQL too eagerly cleanups temporary files for LOAD DATA (SQL_LOAD-...)
Submitted: 20 Sep 2003 7:25 Modified: 24 Sep 2003 14:59
Reporter: Dmitry Lenev Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:4.0.15 OS:Any (any)
Assigned to: Dmitry Lenev

[20 Sep 2003 7:25] Dmitry Lenev
Description:
It seems that MySQL too eagerly cleanups temporary files for LOAD DATA (SQL_LOAD-...). When it processes master restart it will delete all files with SQL_LOAD- prefix from temporary directory. And that is wrong since other MySQL instance can use the same dir for temporary files and so its files will be also deleted as result replication will be broken for this other instance 
(customer describes such situation in his letter). 

How to repeat:
Set up master (server-id=1) and slave (server-id=2) which replicates from this master. Put file named something like SQL_LOAD-notourbussiness.data in temp directory. Restart master. Wait till slave will process this restart.
Look in temp directory - the file will disappear.

Suggested fix:
Delete only files belonging to this server during processing of master restart.
In other words delete only files with 'SQL_LOAD-<server-id>-' prefix.
[24 Sep 2003 14:59] Dmitry Lenev
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

ChangeSet 1.1570.5.1 2003/09/25 01:25:19 dlenev@mysql.com
  Fixed BUG#1357 MySQL too eagerly cleanups temporary files for LOAD DATA (SQL_LOAD-...)