← Back to team overview

maria-developers team mailing list archive

Re: MDEV-7273 - 10.1 fails to start up during tc_log initializations on PPC64

 

Hi, Sergey!

On Dec 17, svoj@xxxxxxxxxxx wrote:
> revision-id: 4a469b0ed68bb341e1a1e1ba540a45a3b6ff3ef9
> parent(s): ea8862aa9ffa1cfac9a99bbe0fe9b539f12b9a19
> committer: Sergey Vojtovich
> branch nick: 10.1
> timestamp: 2014-12-17 13:55:01 +0400
> message:
> 
> MDEV-7273 - 10.1 fails to start up during tc_log initializations on PPC64
> 
> log-tc-size is 24K by default. Page size is 64K on PPC64. But log-tc-size
> must be at least 3 x page size. This is enforced by TC_LOG_MMAP::open()
> with a comment: to guarantee non-empty pool.
> 
> This all makes server not startable in default configuration on PPC64.
> 
> When creating tc log, adjust it's size to max(log-tc-size, page size * 6).
> 
> ---
>  sql/log.cc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sql/log.cc b/sql/log.cc
> index 24e5283..a2fd70f 100644
> --- a/sql/log.cc
> +++ b/sql/log.cc
> @@ -8316,7 +8316,7 @@ int TC_LOG_MMAP::open(const char *opt_name)
>                                 O_RDWR, MYF(MY_WME))) < 0)
>        goto err;
>      inited=1;
> -    file_length= opt_tc_log_size;
> +    file_length= MY_MAX(tc_log_page_size * 2 * 3, opt_tc_log_size);
>      if (mysql_file_chsize(fd, file_length, 0, MYF(MY_WME)))
>        goto err;
>    }

I don't particularly like silent adjustments of user-specified values.
And anyway, as you found out, this fix is not sufficient.

I'd suggest the following:

1. Create a sysvar for log-tc-size
2. invoke my_getpagesize() not from log.cc, but from mysqld.cc, and set
   min and default values for log-tc-size appropriately, don't forget to
   use SYSVAR_AUTOSIZE()
3. change the code not to depend on the TC_LOG_PAGE_SIZE constant.
 - it's basically used in only two places now: to set a default for
   TC_LOG_MIN_SIZE (but you'll fix it step 2) and in kristian's code for
   group commit, cookies[] array.
 - don't mind TC_LOG_PAGE_SIZE being used in TC_LOG_BINLOG, it means
   nothing there, any reasonable number will do, I suppose.
 - so basically you only need to remove TC_LOG_PAGE_SIZE from cookies[]
   array. That is, you can define it as 'ulong cookies[1]' and take
   care to fix all sizeof() in the code to add the real size there.
4. Then you can remove that assert. The tc log page will be of
   my_getpagesize() size and log-tc-size will be N*my_getpagesize()
   where N>3.

Regards,
Sergei