Bug #42150 binlog_start_comment.test failed: Error writing file 'UNOPENED'
Submitted: 16 Jan 2009 8:53 Modified: 6 Mar 2010 23:29
Reporter: Zhenxing He Email Updates:
Status: Closed Impact on me:
None 
Category:Tests: Replication Severity:S3 (Non-critical)
Version:6.0-rpl OS:Windows
Assigned to: CPU Architecture:Any
Tags: 6.0-rpl-green

[16 Jan 2009 8:53] Zhenxing He
Description:
binlog.binlog_start_comment.test started to fail with the following error since Dec 26 in PB of mysql-6.0-rpl:

mysqltest: At line 9: query 'drop table if exists t1,t2' failed: 3: Error writing file 'UNOPENED' (Errcode: 9)

The result from queries just before the failure was:
reset master;

Warnings from just before the error:
Note 1051 Unknown table 't1'

binlog.binlog_row_ctype_ucs.test also failed with a similar error:

mysqltest: At line 9: query 'drop table if exists t1,t2' failed: 3: Error writing file 'UNOPENED' (Errcode: 9)

The result from queries just before the failure was:
reset master;

Warnings from just before the error:
Note 1051 Unknown table 't1'

How to repeat:
xref:
http://tinyurl.com/72oh2k
[16 Jan 2009 8:59] Zhenxing He
This problem only happens on Windows machines.
[22 Jan 2009 7:58] Guangbao Ni
The following is the smallest test case can trigger this bug.

source include/have_log_bin.inc;
flush logs;
flush logs;
let $MYSQLD_DATADIR= `select @@datadir`;
remove_file $MYSQLD_DATADIR/master-bin.000001;
reset master;
drop table if exists t1, t2;

After remove_file command, reset master can't properly delete log files in index file.

and there is the eror message (Got exception in exception handler!) in  mysqld.err.
[23 Jan 2009 11:41] 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/63893

2784 Guangbao Ni	2009-01-23
      Bug #42150  	binlog_start_comment.test failed: Error writing file 'UNOPENED'
[23 Jan 2009 12:37] 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/63898

2784 Guangbao Ni	2009-01-23
      Bug #42150 binlog_start_comment.test failed: Error writing file 'UNOPENED'
[26 Jan 2009 19: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/64085

2795 Andrei Elkin	2009-01-26
      Bug #42150 binlog_start_comment.test failed: Error writing file 'UNOPENED'
      
      The most probable reason for the bug was an error in deleting of unexisted binlog file at
      handling `reset master'. That led to skipping re-opening a new binlog and a reaction on
      a query reported on the bug page.
      
      Fixed with reporting by nt_share_delete() ENOENT back to the caller when the being deleted file
      can't be found. This policy is in accordance with the unix equivalent my_delete().
[29 Jan 2009 16:49] Alfranio Junior
I was not able to reproduce Guangbao's results based on the following test case:

------------------------------------------------------------------------
source include/have_log_bin.inc;
flush logs;
flush logs;
let $MYSQLD_DATADIR= `select @@datadir`;
remove_file $MYSQLD_DATADIR/master-bin.000001;
reset master;
drop table if exists t1, t2;

After remove_file command, reset master can't properly delete log files in index file.

and there is the eror message (Got exception in exception handler!) in  mysqld.err.
------------------------------------------------------------------------

Maybe this is a bug in the windows' libraries.
[2 Feb 2009 17:35] 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/64905

3002 Andrei Elkin	2009-02-02
      Bug #42150 binlog_start_comment.test failed: Error writing file 'UNOPENED'
      
      The reason of the bug appeared to be overreacting on absense of a binlog 
      file although the file name is presented in in the master binlog index file.
      By convention, there should be only a warning printed and the rest of 
      `reset master' logics be completed.
      This did not happen on windows due to incorrect value of my_errno returned
      from nt_share_delete().
      
      Fixed with correcting my_errno assignment in nt_share_delete() to be ENOENT in 
      the event of no binlog file. Some minor refactoring has been made.
[2 Feb 2009 17: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/64908

3002 Andrei Elkin	2009-02-02
      Bug #42150 binlog_start_comment.test failed: Error writing file 'UNOPENED'
      
      The reason of the bug appeared to be overreacting on absense of a
      binlog file although the file name had been presented in in the master
      binlog index file.
      By convention, there should have been only a warning printed and the rest of
      `reset master' logics completed.  This did not happen on windows
      due to incorrect value of my_errno returned from nt_share_delete().
      
      Fixed with correcting my_errno assignment in nt_share_delete() to be ENOENT in 
      he event of no binlog file. Some minor refactoring has been made.
[2 Feb 2009 20:13] Andrei Elkin
Pushed to 5.1-bt by Andrei.
[2 Feb 2009 20:14] Andrei Elkin
correction: pushed to 6.0-bt.
[3 Feb 2009 17:04] 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/65031

3010 Andrei Elkin	2009-02-03
      Bug #42150 binlog_start_comment.test failed: Error writing file 'UNOPENED'
      
      issue with merge.test:
      https://intranet.mysql.com/secure/pushbuild/showpush.pl?dir=bzr_mysql-6.0-bugteam&order=47...
      
      Fixed with moving nt_share_delete():errno into the loop to reset at the beginning a possible
      last time non-zero.
[3 Feb 2009 20:04] Andrei Elkin
The last patch has been pushed to 6.0-bt. No regression of `merge.test' afterwards.
[4 Feb 2009 11:17] Bugs System
Pushed into 6.0.10-alpha (revid:kostja@sun.com-20090204104420-mw1i2u9lum4bxjo6) (version source revid:aelkin@mysql.com-20090203170358-edc9w0jtlyck53vg) (merge vers: 6.0.10-alpha) (pib:6)
[4 Feb 2009 11:48] Jon Stephens
Documented bugfix in the 6.0.10 changelog as follows:

        On Windows, RESET MASTER failed in the event of a missing binlog
        file rather than issuing a warning and completing the rest of
        the statement.
[24 Nov 2009 15:00] 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/91429

3146 Luis Soares	2009-11-24
      BUG#42150: binlog_start_comment.test failed: Error writing file 'UNOPENED'
      
      NOTE: backporting BUG#42150 into next-mr
            Includes latest Andrei's patch (see [2 Feb 18:40] Bugs System)
            and merge.test post-push fix (see [3 Feb 18:04] Bugs System)
      
      The reason of the bug appeared to be overreacting on absense of a
      binlog file although the file name had been presented in in the master
      binlog index file.
      By convention, there should have been only a warning printed and the rest of
      `reset master' logics completed.  This did not happen on windows
      due to incorrect value of my_errno returned from nt_share_delete().
            
      Fixed with correcting my_errno assignment in nt_share_delete() to be ENOENT in 
      he event of no binlog file. Some minor refactoring has been made.
[2 Dec 2009 15:47] Bugs System
Pushed into 6.0.14-alpha (revid:aelkin@mysql.com-20091202145207-zjr6kdpwm5z5jj2z) (version source revid:aelkin@mysql.com-20091202145207-zjr6kdpwm5z5jj2z) (merge vers: 6.0.14-alpha) (pib:13)
[2 Dec 2009 15:48] Bugs System
Pushed into 5.6.0-beta (revid:aelkin@mysql.com-20091201190718-ls6a6i82bs4vovf9) (version source revid:aelkin@mysql.com-20091201190718-ls6a6i82bs4vovf9) (merge vers: 5.6.0-beta) (pib:13)
[3 Dec 2009 11:19] Jon Stephens
Already documented in 6.0.10 changelog; added changelog entry to 5.6.0 changelog. Closed.
[6 Mar 2010 11:04] Bugs System
Pushed into 5.5.3-m3 (revid:alik@sun.com-20100306103849-hha31z2enhh7jwt3) (version source revid:vvaintroub@mysql.com-20091202211633-8reso8l6h11gw9ot) (merge vers: 5.6.0-beta) (pib:16)
[6 Mar 2010 23:29] Paul DuBois
Moved 5.6.0 changelog entry to 5.5.3.