Bug #33332 assert at the end of mysql_binlog_send
Submitted: 18 Dec 2007 14:06 Modified: 16 Feb 2008 11:37
Reporter: Andrei Elkin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: Andrei Elkin CPU Architecture:Any
Tags: heartbeat

[18 Dec 2007 14:06] Andrei Elkin
Description:
Core dumps left after some tests with mysql-5.1-telco-6.3 shows the stack

#5  0x00002af2ef377660 in abort () from /lib/libc.so.6
#6  0x00002af2ef36f436 in __assert_fail () from /lib/libc.so.6
#7  0x0000000000694c84 in Diagnostics_area::set_eof_status (this=0x1f05670, d=0x1f04268) at sql_class.cc:418
#8  0x00000000005ce1e2 in send_eof (thd=0x1f04268) at sql_class.h:2116
#9  0x0000000000858707 in mysql_binlog_send

How to repeat:
It's necessary to have at least two tests

./mysql-test-run.pl --mtr=113 --vardir=/dev/shm/var rpl_ndb.rpl_ndb_UUID rpl_ndb.rpl_ndb_add_column 

Suggested fix:
Check net_flush return value before to generate the return value of
send_heartbeat_event().
[18 Dec 2007 14:11] 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/40137

ChangeSet@1.2804, 2007-12-18 16:10:51+02:00, aelkin@koti.dsl.inet.fi +1 -0
  Bug #33332 assert at the end of mysql_binlog_send
  
  The heartbeat code did not check possible error in net_flush which
  kept the dump thread hanging in heartbeating loop even though
  the slave has disappeared.
  When eventaully the dump thread was killed its cleanup did not use the error
  path and that led to an assert.
  
  Fixed with adding the check of net_flush return value. If one happens
  send_heartbeat_event() returns the error which forces the dump thread
  to exit along the error path.
[21 Dec 2007 20:49] Andrei Elkin
Patch was queued to mysql-5.1-telco-6.3
[21 Dec 2007 20:49] Andrei Elkin
Patch was queued to mysql-5.1-telco-6.3
[15 Feb 2008 13:41] Bugs System
Pushed into 6.0.5-alpha
[16 Feb 2008 11:37] Jon Stephens
Documented bugfix in the 5.1.23-ndb-6.3.8 and 6.0.5 changelogs as follows:

        The code implementing heartbeats did not check for possible
        errors in some circumstances; this kept the dump thread hanging
        while waiting for heartbeats loop even though the slave was no
        longer connected.