Bug #79 relay_log_space_limit can cause deadlock if we have a big transaction
Submitted: 16 Feb 2003 10:44 Modified: 17 Mar 2003 14:08
Reporter: Guilhem Bichot Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:4.0 OS:Any (all)
Assigned to: Guilhem Bichot CPU Architecture:Any

[16 Feb 2003 10:44] Guilhem Bichot
Description:
When using the relay_log_space_limit (undocumented) option, the I/O slave thread will block if the cumulative size of relay logs exceeds relay_log_space_limit ; but this can cause a deadlock if the SQL slave thread is executing a transaction, and cannot free the space because the COMMIT is not in the relay log (and it will never be as the I/O thread is blocked).

How to repeat:
InnoDB
+ 1MB transaction on the master
+ relay_log_space_limit=1024 on the slave
Then do :
START SLAVE
The replication does not make any progress, and it's impossible to STOP SLAVE.
Only 'kill -9' works.

Suggested fix:
I have a patch, will send it with other patches (for #52, #53 and #70).
-- 
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Mr. Guilhem Bichot <guilhem@mysql.com>
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Full-Time Software Developer
/_/  /_/\_, /___/\___\_\___/   Bordeaux, France
       <___/   www.mysql.com   +33 5 56 88 34 39
[3 Mar 2003 6:49] Guilhem Bichot
need a bit of time to finish the patch (same as #53)
[11 Mar 2003 6:05] Guilhem Bichot
It is non-critical as it happens only when one uses --relay_log_space_limit which is undocumented. Will be fixed in 4.0 some day (I have a patch but it's low priority).
[17 Mar 2003 14:08] Guilhem Bichot
Thank you for your bug report. This issue has been fixed in the latest
development tree for that product. You can find more information about
accessing our development trees at 
    http://www.mysql.com/doc/en/Installing_source_tree.html