Bug #44779 binlog.binlog_max_extension may be causing failure on next test in PB
Submitted: 11 May 2009 9:55 Modified: 8 Mar 2010 19:50
Reporter: Luis Soares Email Updates:
Status: Closed Impact on me:
None 
Category:Tests: Replication Severity:S3 (Non-critical)
Version:6.0,5.4 OS:Microsoft Windows (x86 only)
Assigned to: Luis Soares CPU Architecture:Any
Tags: disabled, windows x86
Triage: Triaged: D3 (Medium)

[11 May 2009 9:55] Luis Soares
Description:
binlog.binlog_row_ctype_ucs and binlog.binlog_start_comment both fail in rpl tree after the same test case executes before them:

  * binlog.binlog_max_extension

==== binlog.binlog_row_ctype_ucs failure:

binlog.binlog_row_ctype_ucs              [ fail ]
        Test ended at 2009-04-30 05:28:30

CURRENT_TEST: binlog.binlog_row_ctype_ucs
mysqltest: In included file ".\include\show_binlog_events.inc": At line 10: query 'show binlog events from $binlog_start' failed: 29: File '.\master-bin.000001' not found (Errcode: 2)

The result from queries just before the failure was:
SET TIMESTAMP=10000;
create table t2 (c char(30)) charset=ucs2;
set @v=convert('abc' using ucs2);
reset master;
insert into t2 values (@v);

Warnings from just before the error:
Error 29 File '.\master-bin.000001' not found (Errcode: 2)

 - saving 'e:/pb/bzr_mysql-6.0-rpl/218/mysql-6.0.12-alpha-pb218/mysql-test/var-ps_row-6/log/binlog.binlog_row_ctype_ucs/' to 'e:/pb/bzr_mysql-6.0-rpl/218/mysql-6.0.12-alpha-pb218/mysql-test/var-ps_row-6/log/binlog.binlog_row_ctype_ucs/'

Retrying test, attempt(2/3)...

binlog.binlog_row_ctype_ucs              [ retry-pass ]     63

Retrying test, attempt(3/3)...

binlog.binlog_row_ctype_ucs              [ retry-pass ]     62

==== binlog.binlog_start_comment failure:

binlog.binlog_start_comment              [ fail ]
        Test ended at 2009-05-08 12:55:03

CURRENT_TEST: binlog.binlog_start_comment
mysqltest: At line 13: query 'load data infile '../../std_data/words.dat' into table t1 -- load data to t1' failed: 2013: Lost connection to MySQL server during query

The result from queries just before the failure was:
reset master;
drop table if exists t1,t2;
create table t1 (word varchar(20)) -- create table t1;
create table t2 (word varchar(20)) -- create table t2;

 - saving 'e:/pb/bzr_mysql-6.0-rpl/223/mysql-6.0.12-alpha-pb223/mysql-test/var-n_mix-5/log/binlog.binlog_start_comment/' to 'e:/pb/bzr_mysql-6.0-rpl/223/mysql-6.0.12-alpha-pb223/mysql-test/var-n_mix-5/log/binlog.binlog_start_comment/'
 - found 'mysqld.dmp' (0/5)

Trying 'cdb' to get a backtrace
Cannot find cdb. Please Install Debugging tools for Windows
from http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx

Retrying test, attempt(2/3)...

binlog.binlog_start_comment              [ retry-pass ]     93

Retrying test, attempt(3/3)...

binlog.binlog_start_comment              [ retry-pass ]    110

How to repeat:
== failure detail

* binlog.binlog_start_comment
  'win2003-x86' -max-nt
  n_mix
  https://intranet.mysql.com/secure/pushbuild/showpush.pl?dir=bzr_mysql-6.0-rpl&order=223

* binlog.binlog_row_ctype_ucs
 'win2003-x86' -max-nt
 ps_row
 https://intranet.mysql.com/secure/pushbuild/showpush.pl?dir=bzr_mysql-6.0-rpl&order=223

== xref:
  * binlog.binlog_start_comment
    http://tinyurl.com/peur4s

  * binlog.binlog_row_ctype_ucs
    http://tinyurl.com/p3s62x

Suggested fix:
Inspect binlog_max_extension behavior in windows 2003 x86 and correlate with failures.
[11 May 2009 10:23] 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/73733

2847 Luis Soares	2009-05-11
      BUG#44779: binlog.binlog_max_extension may be causing failure on next 
      test in PB
      
      Disabling test while conducting analysis.
[12 May 2009 8:40] Luis Soares
Disabling binlog.binlog_max_extension makes the failure of the other tests go away.
[13 May 2009 3:31] Bugs System
Pushed into 6.0.12-alpha (revid:alik@sun.com-20090513032549-rxa73jbxd1qv09xc) (version source revid:luis.soares@sun.com-20090511102235-nii3yhg3ozcw1tlm) (merge vers: 6.0.12-alpha) (pib:6)
[5 Jun 2009 15:59] Luis Soares
Looking at PB2 var dirs, one finds in master-bin.index file the following:

  .\master-bin.000001
  ./master-bin.2147483646^M
  .\master-bin.2147483647

Most likely binlog.binlog_max_extension is generating corrupted master-bin.index (generating master-bin.index part of the test seems not portable). That part of the test needs to be reworked as corrupted/malformed master-bin.index persists and is reused in the test executed immediately afterwards.
[16 Jun 2009 9:38] 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/76359

2859 Luis Soares	2009-06-16
      BUG#44779: binlog.binlog_max_extension may be causing failure on next
      test in PB
      
      binlog_max_extension was causing adjacent tests on windows to
      fail. This was due to the fact that this test relied on instrumented
      mysql-bin.index file and instrumentation was not done properly on
      windows. As such, test would not clean up nicely, causing subsequent
      tests to fail.
      
      This patch addresses this issue by reworking the instrumentation of
      mysql-bin.index and by improving the clean up stage (make it the dual
      of prepare state).
     @ mysql-test/suite/binlog/t/disabled.def
        Reenabling the test case.
[26 Jun 2009 14:29] 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/77352

2815 Luis Soares	2009-06-26
      BUG#44779: binlog.binlog_max_extension may be causing failure on next
      test in PB
            
      binlog_max_extension was causing adjacent tests on windows to
      fail. This was due to the fact that this test relied on instrumented
      mysql-bin.index file and instrumentation was not done properly on
      windows. As such, test would not clean up nicely, causing subsequent
      tests to fail.
            
      This patch addresses this issue by reworking the instrumentation of
      mysql-bin.index and by improving the clean up stage (make it the dual
      of prepare state).
     @ mysql-test/suite/binlog/t/disabled.def
        Reenabling the test case.
[29 Jun 2009 8:46] Luis Soares
Pushed to mysql-azalea-bugfixing.
[3 Jul 2009 6:13] Bugs System
Pushed into 5.4.4-alpha (revid:alik@sun.com-20090702084644-k95gd2asolvz2zpu) (version source revid:luis.soares@sun.com-20090629083542-87rjmhmf34xzmvp3) (merge vers: 5.4.4-alpha) (pib:11)
[9 Jul 2009 7:34] Bugs System
Pushed into 5.4.4-alpha (revid:alik@sun.com-20090702084644-k95gd2asolvz2zpu) (version source revid:luis.soares@sun.com-20090629083542-87rjmhmf34xzmvp3) (merge vers: 5.4.4-alpha) (pib:11)
[9 Jul 2009 12:30] Jon Stephens
Fix affects testing only, no end-user changes to document. Closed without further action.
[29 Sep 2009 13:43] 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/85012

3113 Luis Soares	2009-09-29
      BUG#40611: MySQL cannot make a binary log after sequential number
      beyond unsigned long.
      BUG#44779: binlog.binlog_max_extension may be causing failure on 
      next test in PB
      
      NOTE1: this is the backport to next-mr.
      NOTE2: already includes patch for BUG#44779.
      
      Binlog file extensions would turn into negative numbers once the
      variable used to hold the value reached maximum for signed
      long. Consequently, incrementing value to the next (negative) number
      would lead to .000000 extension, causing the server to fail.
                  
      This patch addresses this issue by not allowing negative extensions
      and by returning an error on find_uniq_filename, when the limit is
      reached. Additionally, warnings are printed to the error log when the
      limit is approaching. FLUSH LOGS will also report warnings to the
      user, if the extension number has reached the limit. The limit has been
      set to 0x7FFFFFFF as the maximum.
     @ mysql-test/suite/binlog/t/binlog_max_extension.test
        Test case added that checks the maximum available number for
        binlog extensions.
     @ sql/log.cc
        Changes to find_uniq_filename and test_if_number.
     @ sql/log.h
        Added macros with values for MAX_LOG_UNIQUE_FN_EXT and
        LOG_WARN_UNIQUE_FN_EXT_LEFT, as suggested in review.
[29 Sep 2009 14:12] 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/85030

3117 Luis Soares	2009-09-29
      BUG#40611: MySQL cannot make a binary log after sequential number
      beyond unsigned long.
      BUG#44779: binlog.binlog_max_extension may be causing failure on 
      next test in PB
            
      NOTE1: this is the backport to next-mr.
      NOTE2: already includes patch for BUG#44779.
            
      Binlog file extensions would turn into negative numbers once the
      variable used to hold the value reached maximum for signed
      long. Consequently, incrementing value to the next (negative) number
      would lead to .000000 extension, causing the server to fail.
                        
      This patch addresses this issue by not allowing negative extensions
      and by returning an error on find_uniq_filename, when the limit is
      reached. Additionally, warnings are printed to the error log when the
      limit is approaching. FLUSH LOGS will also report warnings to the
      user, if the extension number has reached the limit. The limit has been
      set to 0x7FFFFFFF as the maximum.
     @ mysql-test/suite/binlog/t/binlog_max_extension.test
        Test case added that checks the maximum available number for
        binlog extensions.
     @ sql/log.cc
        Changes to find_uniq_filename and test_if_number.
     @ sql/log.h
        Added macros with values for MAX_LOG_UNIQUE_FN_EXT and
        LOG_WARN_UNIQUE_FN_EXT_LEFT, as suggested in review.
[7 Oct 2009 21:13] 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/86062

3131 Luis Soares	2009-10-07
      BUG#40611, BUG#44779: reverted in mysql-5.1-rep+2.
[27 Oct 2009 9:50] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20091027094604-9p7kplu1vd2cvcju) (version source revid:zhenxing.he@sun.com-20091026140226-uhnqejkyqx1aeilc) (merge vers: 6.0.14-alpha) (pib:13)
[27 Oct 2009 17:59] Jon Stephens
Re-closed w/o further action; see my previous comment.
[12 Nov 2009 8:19] Bugs System
Pushed into 5.5.0-beta (revid:alik@sun.com-20091110093229-0bh5hix780cyeicl) (version source revid:alik@sun.com-20091027095744-rf45u3x3q5d1f5y0) (merge vers: 5.5.0-beta) (pib:13)
[12 Nov 2009 12:09] Jon Stephens
Re-closed w/o further action; see previous comments.
[22 Nov 2009 4: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/91231

3145 Luis Soares	2009-11-22
      BUG#40611: MySQL cannot make a binary log after sequential number
      beyond unsigned long.
      BUG#44779: binlog.binlog_max_extension may be causing failure on 
      next test in PB
                  
      NOTE1: this is the backport to next-mr.
      NOTE2: already includes patch for BUG#44779.
                  
      Binlog file extensions would turn into negative numbers once the
      variable used to hold the value reached maximum for signed
      long. Consequently, incrementing value to the next (negative) number
      would lead to .000000 extension, causing the server to fail.
                              
      This patch addresses this issue by not allowing negative extensions
      and by returning an error on find_uniq_filename, when the limit is
      reached. Additionally, warnings are printed to the error log when the
      limit is approaching. FLUSH LOGS will also report warnings to the
      user, if the extension number has reached the limit. The limit has been
      set to 0x7FFFFFFF as the maximum.
     @ mysql-test/suite/binlog/r/binlog_max_extension.result
        
     @ mysql-test/suite/binlog/t/binlog_max_extension.test
        Test case added that checks the maximum available number for
        binlog extensions.
     @ sql/log.cc
        Changes to find_uniq_filename and test_if_number.
     @ sql/log.h
        Added macros with values for MAX_LOG_UNIQUE_FN_EXT and
        LOG_WARN_UNIQUE_FN_EXT_LEFT, as suggested in review.
[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:47] 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:23] Jon Stephens
Re-closed w/o further action; see previous comments.
[6 Mar 2010 10:59] 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)
[8 Mar 2010 19:50] Jon Stephens
Closed without taking any further action; changes affected testing only.