Bug #35675 reset master finds assert if a binlog file can not be deleted
Submitted: 29 Mar 2008 17:44 Modified: 9 Apr 2008 15:47
Reporter: Andrei Elkin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.1 OS:Any
Assigned to: Andrei Elkin CPU Architecture:Any
Tags: purge_binlog, reset_master

[29 Mar 2008 17:44] Andrei Elkin
Description:
If a binlog file is manually replaced with a namesake directory the internal purging did not handle the error of deleting the file so that eventually
a post-execution guards stops the show:
 

mysqld: sql_class.cc:398: void Diagnostics_area::set_ok_status(THD*, ha_rows, ulonglong, const char*): Assertion `! is_set()' failed.

The reason of the assert is obviously the lack of handling of the error situation.]

How to repeat:
mtr binlog_index

(the new test coming from 5.0-rpl)

Actually it's enough to have steps:

1. rm  the-first-binlog-file
2. mkdir the-first-binlog-file
3. start the server
4. reset master -> to assert
[29 Mar 2008 17:48] 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/44638

ChangeSet@1.2554, 2008-03-29 19:46:19+02:00, aelkin@mysql1000.(none) +1 -0
  Bug #35675  	reset master finds assert if a binlog file can not be deleted
  
  If a binlog file is manually replaced with a namesake directory the internal purging did
  not handle the error of deleting the file so that eventually
  a post-execution guards fires an assert.
  
  Fixed with reusing a snippet of code for bug@18199 to tolerate lack of the file but no other error 
  at an attempt to delete it.
  The same applied to the index file deletion.
[29 Mar 2008 22: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/44644

ChangeSet@1.2554, 2008-03-30 00:49:14+02:00, aelkin@mysql1000.(none) +8 -0
  Bug #35675  	reset master finds assert if a binlog file can not be deleted
  
  If a binlog file is manually replaced with a namesake directory the internal purging did
  not handle the error of deleting the file so that eventually
  a post-execution guards fires an assert.
  
  Fixed with reusing a snippet of code for bug@18199 to tolerate lack of the file but no other error 
  at an attempt to delete it.
  The same applied to the index file deletion.
  
  The cset carries pieces of manual merging.
[29 Mar 2008 22:56] 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/44645

ChangeSet@1.2554, 2008-03-30 00:54:08+02:00, aelkin@mysql1000.(none) +9 -0
  Bug #35675  	reset master finds assert if a binlog file can not be deleted
  
  If a binlog file is manually replaced with a namesake directory the internal purging did
  not handle the error of deleting the file so that eventually
  a post-execution guards fires an assert.
  
  Fixed with reusing a snippet of code for bug@18199 to tolerate lack of the file but no other error 
  at an attempt to delete it.
  The same applied to the index file deletion.
  
  The cset carries pieces of manual merging.
[30 Mar 2008 13:23] Andrei Elkin
Patch queued to mysql-5.1-rpl-merge.
[31 Mar 2008 7:56] Bugs System
Pushed into 5.1.24-rc
[1 Apr 2008 19:05] Paul DuBois
Noted in 5.1.24 changelogs.

Binary log purging caused an assertion failure if a binary log file
could not be deleted (such as when the name actually referred to a
directory). 

Resetting report to Patch queued waiting for push into 6.0.x.
[3 Apr 2008 13:02] Bugs System
Pushed into 6.0.5-alpha
[9 Apr 2008 15:47] Jon Stephens
Documented in the 5.1.24 and 6.0.5 changelogs as follows:

        Manually replacing a binary log file with a directory having the same
        name caused an error that was not handled correctly.