List:Commits« Previous MessageNext Message »
From:Andrei Elkin Date:October 19 2007 10:04pm
Subject:Re: bk commit into 5.1 tree (aelkin:1.2578) BUG#28597
View as plain text  
Lars,

> It needs to be able to replicate 5.0-with-20166-patch -> 5.0-new,
> since those are both GA releases.
>
> /L

It would be the ideal way out.
However, it's impossible.

A fact of the matter is that the user can supply binlog name in either
format - i.e with the absolute path format

--log-bin=/tmp/andrei/5.1.16/mysql-test/var/log/master-bin

  or with the relative path format

--log-bin=my_log

  or simply

--log-bin

which is a sub-variation of the relative path format.

For the absolute path format the master server writes into the index
file absolute path format file names.
For the relative path format the master server writes into the index
file relative path format file names.

Since bug#20166 fixes the master started to write *only* with the absolute
path format.

The mixture of formats leads to bug#28597.

So if the user supplies the relative path format file names its master
creates for 

  1. pre-bug20166 lines like

     my_log-bin.000001
     my_log-bin.000002

  2. upgraded from pre-bug20166 to bug20166-fixed
     
     my_log-bin.000001                 # the line before upgrade
     /var/log/.../my_log-bin.000002

    i.e this is the current bug#28597 
  
  3. your suggestion  upgraded bug20166-fixed to bug28597-fixed
     
     /var/log/.../my_log-bin.000001   # the line before upgrade
     my_log-bin.000002

Notice, the line before upgrade does not say which format it was meant
to. This fact is lost but it is cruicial to resolve your requirement.

Alas, i don't see anything but to address the issue of
`upgraded bug20166-fixed to bug28597-fixed'
in docs plus adding a warning like `be prepared your slaves will disconnect because
of ...; do this ...' by which bug28597-fixed would react on the relative
path binlog file name supplied to the master startup options.

cheers,

Andrei

>
>
> On Fri, Oct 19, 2007 at 03:32:53PM +0300, Andrei Elkin wrote:
>> Lars, hi.
>> 
>> > Hi Andrei,
>> >
>> > This patch is only fixing what is written to the index file.
>> >
>> > I don't think this is enough, since BUG#28597 is about an index file
>> > that already exists on the master.  With the exact same file as given
>> > in the bug report, the replication should still work.
>> >
>> 
>> The problem of the bug is in that \cite{cset_comments}
>>  
>>   bug@20166 that replaced the binlog file name generating to favor
>>   pidfile_name instead of the previous glob_hostname generated names
>>   started to be written in the absolute path format.
>> 
>> That bug20166 changes forced writing the names of generated binlog file names
>> in the absolute path format whereas they had been written in the
>> relative path format previously, which was correct.
>> 
>> The patch that cures from this artifact definitely has to strip the dir
>> name part to get the prior-bug20166 behaviour.
>> 
>> Stripping could be done either by reverting the changes of bug#20166
>> or the way I did which also address a pending todo.
>> 
>> Anything wrong with this still?
>> 
>> regards,
>> 
>> Andrei
>> 
>> 
>> > Best wishes,
>> > Lars
>> >
>> >
>> > On Fri, Oct 19, 2007 at 03:02:19PM +0300, Andrei Elkin wrote:
>> >> Below is the list of changes that have just been committed into a local
>> >> 5.1 repository of elkin. When elkin does a push these changes will
>> >> be propagated to the main repository and, within 24 hours after the
>> >> push, to the public repository.
>> >> For information on how to access the public repository
>> >> see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
>> >> 
>> >> ChangeSet@stripped, 2007-10-19 15:02:10+03:00,
> aelkin@stripped +1 -0
>> >>   Bug #28597 Replication doesn't start after upgrading to 5.1.18
>> >>   
>> >>   Since bug@20166 that replaced the binlog file name generating to favor
> pidfile_name instead of 
>> >>   the previous glob_hostname generated names started to be written in
> the absolute path format.
>> >>   
>> >>   Fixed with stripping off the directory part of a generated name that
> also terminates a pending TODO.
>> >>   
>> >>    
>> >> 
>> >>   sql/log.cc@stripped, 2007-10-19 15:02:04+03:00,
> aelkin@stripped +6 -5
>> >>     generating bin-log file name as relative path. Using
> make_default_log_name pattern to eliminate
>> >>     a pending TODO in MYSQL_LOG::generate_name.
>> >> 
>> >> diff -Nrup a/sql/log.cc b/sql/log.cc
>> >> --- a/sql/log.cc	2007-10-12 10:31:59 +03:00
>> >> +++ b/sql/log.cc	2007-10-19 15:02:04 +03:00
>> >> @@ -2166,13 +2166,14 @@ const char *MYSQL_LOG::generate_name(con
>> >>  {
>> >>    if (!log_name || !log_name[0])
>> >>    {
>> >> +    DBUG_ASSERT(strlen(suffix) <= 4);     // avoids overrun
>> >>      /*
>> >> -      TODO: The following should be using fn_format();  We just need
> to
>> >> -      first change fn_format() to cut the file name if it's too long.
>> >> +      generating in style of make_default_log_name
>> >>      */
>> >> -    strmake(buff, pidfile_name, FN_REFLEN - 5);
>> >> -    strmov(fn_ext(buff), suffix);
>> >> -    return (const char *)buff;
>> >> +    strmake(buff, pidfile_name, FN_REFLEN-5);
>> >> +    return (const char *)
>> >> +      fn_format(buff, buff, "", suffix,
>> >> +               
> MYF(MY_UNPACK_FILENAME|MY_REPLACE_EXT|MY_REPLACE_DIR));
>> >>    }
>> >>    // get rid of extension if the log is binary to avoid problems
>> >>    if (strip_ext)
>> >> 
>> >> -- 
>> >> MySQL Code Commits Mailing List
>> >> For list archives: http://lists.mysql.com/commits
>> >> To unsubscribe:    http://lists.mysql.com/commits?unsub=1
>> >
>> > -- 
>> > Dr. Lars Thalmann
>> > Replication and Clustering Technology
>> > MySQL AB, www.mysql.com
>> -- 
>> Andrei Elkin, Software Developer, PhD
>> MySQL Finland Oy, Helsinki, Finland, www.mysql.com
>> 
>> Are you MySQL certified?  www.mysql.com/certification
>
> -- 
> Dr. Lars Thalmann
> Replication and Clustering Technology
> MySQL AB, www.mysql.com
Thread
bk commit into 5.1 tree (aelkin:1.2578) BUG#28597Andrei Elkin19 Oct
Re: bk commit into 5.1 tree (aelkin:1.2578) BUG#28597Andrei Elkin19 Oct
Re: bk commit into 5.1 tree (aelkin:1.2578) BUG#28597Andrei Elkin19 Oct
  • Request for review: bk commit into 5.1 tree (aelkin:1.2578) BUG#28597Andrei Elkin21 Oct
    • Re: Request for review: bk commit into 5.1 tree (aelkin:1.2578) BUG#28597Andrei Elkin25 Oct