List:Commits« Previous MessageNext Message »
From:He Zhenxing Date:December 30 2010 3:37am
Subject:Re: bzr commit into mysql-trunk branch (andrei.elkin:3447) Bug#59179
View as plain text  
Hi Andrei,

I could not access lab machines now, I could not verify your fix and
check, so I have two questions that I'd like you to answer before I
approve the patch:

1) Is it required to change the signature of rotate_and_purge(uint) to
rotate_and_purge(uint8)? From the description, it looks the problem only
lies in bit OR.

2) Could you please dump the assembly code of the original algorithm to
compute the flag so that we can analyze if it is a compiler problem or
not? I could not access lab machines now.

Andrei Elkin wrote:
> #At file:///home/andrei/MySQL/BZR/2a-23May/mysql-5.6.1-m5-release/ based on
> revid:andrei.elkin@stripped
> 
>  3447 Andrei Elkin	2010-12-29
>       bug#59179 binlog_checksum and rpl_checksum_cache time out on Linux in release
> builds
>       
>       The issue appeared to be a hang in attempt to lock a mutex in
> MYSQL_BIN_LOG::rotate_and_purge()
>       which should not be attempted in an execution branch that calls the methods
>       from  Sys_var_enum_binlog_checksum::global_update().
>       The hang is ia64 compilation env specific and is caused by incorrect
> computation of `flags'
>       when its assigment include the third bitwise OR argument that is ( ? : )
> expression.
>       In that case the value of `flags' is always the value of `( ? : )' that is 4 or
> zero.
>       
>       This indicates most probably the ia64 compiler issue.
>       
>       Fixed with splitting flags caclulation into two parts which does not create the
> reported
>       issue but rather the value becomes correct.
>       
>       
>       
>       
>       ******
>       an experimental commit to fixing bug59179.
>      @ sql/binlog.cc
>         signature changed.
>      @ sql/binlog.h
>         Explicit size of a integer is set to rotate_and_purge()'s argument.
>      @ sql/sys_vars.cc
>         splitting flags caclulation into two parts to work around ia64 wrong OR
> evaluation.
> 
>     modified:
>       sql/binlog.cc
>       sql/binlog.h
>       sql/sys_vars.cc
> === modified file 'sql/binlog.cc'
> --- a/sql/binlog.cc	2010-12-17 02:01:32 +0000
> +++ b/sql/binlog.cc	2010-12-28 23:32:47 +0000
> @@ -3483,7 +3483,7 @@ unlock:
>    @retval
>      nonzero - error 
>  */
> -int MYSQL_BIN_LOG::rotate_and_purge(uint flags)
> +int MYSQL_BIN_LOG::rotate_and_purge(uint8 flags)
>  {
>    int error= 0;
>    DBUG_ENTER("MYSQL_BIN_LOG::rotate_and_purge");
> 
> === modified file 'sql/binlog.h'
> --- a/sql/binlog.h	2010-12-10 16:55:50 +0000
> +++ b/sql/binlog.h	2010-12-28 23:32:47 +0000
> @@ -219,7 +219,7 @@ public:
>    void make_log_name(char* buf, const char* log_ident);
>    bool is_active(const char* log_file_name);
>    int update_log_index(LOG_INFO* linfo, bool need_update_threads);
> -  int rotate_and_purge(uint flags);
> +  int rotate_and_purge(uint8 flags);
>    /**
>       Flush binlog cache and synchronize to disk.
>  
> 
> === modified file 'sql/sys_vars.cc'
> --- a/sql/sys_vars.cc	2010-12-20 13:26:51 +0000
> +++ b/sql/sys_vars.cc	2010-12-28 23:32:47 +0000
> @@ -1941,9 +1941,10 @@ bool Sys_var_enum_binlog_checksum::globa
>    mysql_mutex_lock(mysql_bin_log.get_log_lock());
>    if(mysql_bin_log.is_open())
>    {
> -    uint flags= RP_FORCE_ROTATE | RP_LOCK_LOG_IS_ALREADY_LOCKED |
> -      (binlog_checksum_options != (uint) var->save_result.ulonglong_value?
> -       RP_BINLOG_CHECKSUM_ALG_CHANGE : 0);
> +    uint8 flags= (RP_FORCE_ROTATE | RP_LOCK_LOG_IS_ALREADY_LOCKED);
> +    flags |= (binlog_checksum_options !=
> +              (ulong) var->save_result.ulonglong_value?
> +              RP_BINLOG_CHECKSUM_ALG_CHANGE : 0);
>      if (flags & RP_BINLOG_CHECKSUM_ALG_CHANGE)
>        mysql_bin_log.checksum_alg_reset= (uint8)
> var->save_result.ulonglong_value;
>      mysql_bin_log.rotate_and_purge(flags);
> 
> text/bzr-bundle 类型 附件
> (bzr/andrei.elkin@stripped)
> # Bazaar merge directive format 2 (Bazaar 0.90)
> # revision_id: andrei.elkin@stripped
> # target_branch: file:///home/andrei/MySQL/BZR/2a-23May/mysql-5.6.1-\
> #   m5-release/
> # testament_sha1: 1d6ffd2fdf515c1676d38d8c2fb9bf4d9240a927
> # timestamp: 2010-12-29 01:32:55 +0200
> # base_revision_id: andrei.elkin@stripped\
> #   k8ahusqs54lif9ay
> # 
> # Begin bundle
> IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWUOr6FIAA1LfgHAQePP////v
> /iD////0YAfuX2zHdgDTuYortgArFa3WGmpNNE09TQyBGanppPRPUGjQAaANNPSaDQMkJkMmVP0C
> Ymig9T1DQABoNAADQDjJk0YhpoYCaGJo0yYgZGE0aaYQZMMREJ6CT00TT0o9omptI9QAADIGQGj0
> Q4yZNGIaaGAmhiaNMmIGRhNGmmEGTCSQBAJpo0kxpiKn5EMnqJ6j1Hqb1NRtQANoXnLrSkI1GPbv
> SyCNQ0svfAKn3r82Jlh6BwYZH60sVmAqF1EmkT3U0RWoZYNzxhprrAMAPupC4S7gwPyNxSSSRf8d
> AH7jP3WHBFMMwZknqmhCKWgeOXKMTCnZ0dmbpMFTYfjus8XWFi8jVY5HYVhx4MBc1TBazS+0iV9G
> 1RjSHZTK5sT6NR2E5bqXkTwrX/1rSwfZXvVHwkxZtdWaqRJRgBCFFFz72mBVEK8c8hSzGUxekQNz
> xhXPpjbqzbAy7Qs7iTZU3cMuRAsoiYIRaFfXcRSEUOxY3XyoQu58yc03ESSRcCXEoAAcoA4QgkwT
> 4rdpGJuSBGx5VzzpBBO2Rrar1JW9fV9E4HXIDPn3iUURLOKs2VXTVmZt8klubFr3i1EJkAw2nrJr
> z3QTC3DhQooKad5IcpOVSMP3lqgwUeWXfVQSPOlViXa81TIhHGwAYjjbxjy7rkxfQOgOniRb6wF5
> TYG0wdlialG2gZDKc9+BiJnDIc3FfLAHJZbVeLnCsjJHQgSOGMAo78TOExsDEHzYsEYCjQReX8Np
> C0iKuGqdBC8TsfrbF6TEjgYlwbSwvjorlanqStLCYhz7RGTCeTeoy5aPFgmMdhSFXrbCUS8sKrNV
> 5CvnWwe0Uc01gxnyndC6EXtstH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YMYeTAwkwwm2X/XE70KcZWJl7fh39cqoyGZDb6IZqnq9gnzbTSL3bzL5b7wh9oju6CNVd
> vY6e5QV6qku0VwjjZUOX+EuYZCq5eXOVgFepdjqsFqAZBUanimK++Il1vs93XsQnvbwEcBZvaeDB
> kOHdnVJgDg5zKizkrYD41B17dQvaI9RqpnsU7ahAuWg6MLR7JiQxFn/JwYi05iHqUhJ1VsqQNjhw
> mBvxcJS4qA5k8cM1s4CVBxsMYSSKKARRSBSR7ARbtPIEBO+U6g+gbW7+AQQne6HakiN6F90Jp7jS
> N/6IBhY4qw7yCy9RWBfNT4kBtpXqhQhAh0YBGDXd1+fYNIhQ4Z1bYOLYxWIYAKfM6WEwKHhMGQkj
> 1IoqAUSRwEc57Ih2pJbgsgKQRtu61AFYDRFtSqo5gobz4jRZRt0rZKLNe333DxrHDgwL9q//hzH0
> YYbXyiRRvInNdyhQa46geRlMjnuvv8/MuKaocy2xb1IQthkBinL5Q8tqSs5HOM2gWqs3tEHGWyAP
> TkovoYa2dxTJPSl26noWjmUakPEFpVW8B7Q1ANXuxLG3gwiwrJCJDeVwfRmWFkkXRC4aWAnrUTX2
> JyKD03gIdQ6hWrJxgJIJnTpGZwCzOuR5ISJgyVy3bAioRkK6MECVRkCX9ywZhXRUBXiGWfrm0HMN
> i3EUtaCHcBvtYDr2wUNOIMjqZAq9uY2dosj4UAul1Sof8XckU4UJBDq+hSA=
> 
> 


Thread
bzr commit into mysql-trunk branch (andrei.elkin:3447) Bug#59179Andrei Elkin29 Dec
  • Re: bzr commit into mysql-trunk branch (andrei.elkin:3447) Bug#59179He Zhenxing30 Dec