Bug #31024 STOP SLAVE does not stop attempted connect()s
Submitted: 14 Sep 2007 10:30 Modified: 26 Mar 9:31
Reporter: Domas Mituzas
Status: Closed
Category:Server: Replication Severity:S2 (Serious)
Version:5.0-bk, 5.1-bk OS:Any
Assigned to: Sven Sandberg Target Version:5.0+
Tags: Delay, timeout, stop slave, start slave
Triage: D2 (Serious)

[14 Sep 2007 10:30] Domas Mituzas
Description:
If I/O thread is attempting to connect, SLAVE STOP will wait for that attempt to finish
instead of interrupting it immediately. Combined with Bug#30932 this is serious trouble,
as connects wait for minutes and it is impossible to control that. 

How to repeat:
IP addresses are of hosts that are down

Server version: 5.1.23-beta-debug-log Source distribution

mysql> change master to master_host='192.168.1.111';
Query OK, 0 rows affected (0.06 sec)
mysql> slave start;
Query OK, 0 rows affected (0.00 sec)
mysql> slave stop;
Query OK, 0 rows affected (1 min 14.03 sec)

===

Server version: 5.0.50-debug-log Source distribution

mysql> change master to master_host='192.168.1.112';
Query OK, 0 rows affected (0.79 sec)
mysql> slave start;
Query OK, 0 rows affected (0.00 sec)
mysql> slave stop;
Query OK, 0 rows affected (1 min 14.00 sec)

Suggested fix:
stop the slave immediately, don't wait for timeout.
[27 Feb 13:40] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/43044

ChangeSet@1.2576, 2008-02-27 16:40:28+04:00, ramil@mysql.com +1 -0
  Fix for bug #31024: STOP SLAVE does not stop attempted connect()s
  
  Problem: if the IO slave thread is attempting to connect,
  STOP SLAVE waits for the attempt to finish. 
  It might take too long.
  
  Fix: don't wait, stop the slave immediately.
[11 Mar 9:59] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/43743

ChangeSet@1.2589, 2008-03-11 10:03:23+01:00, sven@riska.(none) +2 -0
  BUG#31024: STOP SLAVE does not stop attempted connect()s
  Problem: if the IO slave thread is attempting to connect,
  STOP SLAVE waits for the attempt to finish. 
  It may take a long time.
  Fix: don't wait, stop the slave immediately.
[11 Mar 13:57] Sven Sandberg
Committed a patch at https://intranet.mysql.com/secure/paste/displaypaste.php?codeid=3573
I have no idea why it doesn't show up automatically.
[12 Mar 0:51] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/43751

ChangeSet@1.2589, 2008-03-11 12:38:52+01:00, sven@riska.(none) +2 -0
  BUG#31024: STOP SLAVE does not stop attempted connect()s
  Problem: if the IO slave thread is attempting to connect,
  STOP SLAVE waits for the attempt to finish. 
  It may take a long time.
  Fix: don't wait, stop the slave immediately.
[12 Mar 0:51] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/43753

ChangeSet@1.2589, 2008-03-11 13:01:37+01:00, sven@riska.(none) +2 -0
  BUG#31024: STOP SLAVE does not stop attempted connect()s
  Problem: if the IO slave thread is attempting to connect,
  STOP SLAVE waits for the attempt to finish. 
  It may take a long time.
  Fix: don't wait, stop the slave immediately.
[12 Mar 0:53] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/43757

ChangeSet@1.2589, 2008-03-11 13:01:37+01:00, sven@riska.(none) +2 -0
   BUG#31024: STOP SLAVE does not stop attempted connect()s
   Problem: if the IO slave thread is attempting to connect,
   STOP SLAVE waits for the attempt to finish.
   It may take a long time.
   Fix: don't wait, stop the slave immediately.
[12 Mar 0:55] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/43763

ChangeSet@1.2597, 2008-03-11 14:42:54+01:00, sven@riska.(none) +2 -0
  BUG#31024: STOP SLAVE does not stop attempted connect()s
  Problem: if the IO slave thread is attempting to connect,
  STOP SLAVE waits for the attempt to finish. 
  It may take a long time.
  Fix: don't wait, stop the slave immediately.
[17 Mar 4:53] Sven Sandberg
patch pushed to 5.0-rpl
[25 Mar 12:22] Bugs System
Pushed into 5.0.60
[25 Mar 12:23] Bugs System
Pushed into 5.1.24-rc
[26 Mar 9:31] Jon Stephens
Documented bugfix in the 5.0.60 and 5.1.24 changelogs as follows:

        STOP SLAVE did not stop connection attempts properly.
        If the IO slave thread was attempting to connect, STOP
        SLAVE waited for the attempt to finish, sometimes for a long
        period of time, rather than stopping
        the slave immediately.
[26 Mar 20:01] Bugs System
Pushed into 6.0.5-alpha
[30 Mar 21:49] Jon Stephens
Also documented for 5.1.23-ndb-6.3.11 and 6.0.5.