diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2014-12-26 23:38:45 +0400 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2015-03-05 16:59:06 -0500 |
commit | 6f9e33ecb020bcf3e6db246bc04a9be153c63dc4 (patch) | |
tree | 4a64acfc9661e941307c5bf05becf68bbfe2482e | |
parent | 9af42db6138a555454b7631761b81f8d259f014e (diff) | |
download | mariadb-git-6f9e33ecb020bcf3e6db246bc04a9be153c63dc4.tar.gz |
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.
Autosize log-tc-size, so that it's min value= page size * 3, default
value= page size * 6, block size= page size.
Conflicts:
mysql-test/suite/sys_vars/inc/sysvars_server.inc
mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
mysql-test/t/mysqld--help.test
sql/mysqld.cc
sql/sys_vars.cc
-rw-r--r-- | mysql-test/r/mysqld--help.result | 1 | ||||
-rw-r--r-- | mysql-test/suite/sys_vars/r/log_tc_size_basic.result | 4 | ||||
-rw-r--r-- | mysql-test/suite/sys_vars/t/log_tc_size_basic.test | 5 | ||||
-rw-r--r-- | mysql-test/t/mysqld--help.test | 2 | ||||
-rw-r--r-- | sql/log.cc | 11 | ||||
-rw-r--r-- | sql/log.h | 3 | ||||
-rw-r--r-- | sql/mysqld.cc | 6 | ||||
-rw-r--r-- | sql/sys_vars.cc | 10 |
8 files changed, 26 insertions, 16 deletions
diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result index e4db1fa2aba..44b3d8df0f9 100644 --- a/mysql-test/r/mysqld--help.result +++ b/mysql-test/r/mysqld--help.result @@ -1248,7 +1248,6 @@ log-slow-rate-limit 1 log-slow-slave-statements FALSE log-slow-verbosity log-tc tc.log -log-tc-size 24576 log-warnings 1 long-query-time 10 low-priority-updates FALSE diff --git a/mysql-test/suite/sys_vars/r/log_tc_size_basic.result b/mysql-test/suite/sys_vars/r/log_tc_size_basic.result new file mode 100644 index 00000000000..8097fcf61bd --- /dev/null +++ b/mysql-test/suite/sys_vars/r/log_tc_size_basic.result @@ -0,0 +1,4 @@ +SET GLOBAL log_tc_size=1; +ERROR HY000: Variable 'log_tc_size' is a read only variable +SET SESSION log_tc_size=1; +ERROR HY000: Variable 'log_tc_size' is a read only variable diff --git a/mysql-test/suite/sys_vars/t/log_tc_size_basic.test b/mysql-test/suite/sys_vars/t/log_tc_size_basic.test new file mode 100644 index 00000000000..221338d0304 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/log_tc_size_basic.test @@ -0,0 +1,5 @@ +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET GLOBAL log_tc_size=1; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET SESSION log_tc_size=1; diff --git a/mysql-test/t/mysqld--help.test b/mysql-test/t/mysqld--help.test index 96bbfccb568..0f46300a440 100644 --- a/mysql-test/t/mysqld--help.test +++ b/mysql-test/t/mysqld--help.test @@ -22,7 +22,7 @@ perl; log-slow-queries pid-file slow-query-log-file log-basename datadir slave-load-tmpdir tmpdir socket thread-pool-size large-files-support lower-case-file-system system-time-zone - wsrep-node-name wsrep-data-home-dir version.*/; + wsrep-node-name wsrep-data-home-dir log-tc-size version.*/; # Plugins which may or may not be there: @plugins=qw/innodb ndb archive blackhole federated partition ndbcluster diff --git a/sql/log.cc b/sql/log.cc index 69e0ed34b01..37e19dac564 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -8432,7 +8432,7 @@ ulong tc_log_page_waits= 0; static const uchar tc_log_magic[]={(uchar) 254, 0x23, 0x05, 0x74}; -ulong opt_tc_log_size= TC_LOG_MIN_SIZE; +ulong opt_tc_log_size; ulong tc_log_max_pages_used=0, tc_log_page_size=0, tc_log_cur_pages_used=0; int TC_LOG_MMAP::open(const char *opt_name) @@ -8445,7 +8445,6 @@ int TC_LOG_MMAP::open(const char *opt_name) DBUG_ASSERT(opt_name && opt_name[0]); tc_log_page_size= my_getpagesize(); - DBUG_ASSERT(TC_LOG_PAGE_SIZE % tc_log_page_size == 0); fn_format(logname,opt_name,mysql_data_home,"",MY_UNPACK_FILENAME); if ((fd= mysql_file_open(key_file_tclog, logname, O_RDWR, MYF(0))) < 0) @@ -8784,6 +8783,7 @@ mmap_do_checkpoint_callback(void *data) int TC_LOG_MMAP::unlog(ulong cookie, my_xid xid) { pending_cookies *full_buffer= NULL; + uint32 ncookies= tc_log_page_size / sizeof(my_xid); DBUG_ASSERT(*(my_xid *)(data+cookie) == xid); /* @@ -8797,7 +8797,7 @@ int TC_LOG_MMAP::unlog(ulong cookie, my_xid xid) mysql_mutex_lock(&LOCK_pending_checkpoint); if (pending_checkpoint == NULL) { - uint32 size= sizeof(*pending_checkpoint); + uint32 size= sizeof(*pending_checkpoint) + sizeof(ulong) * (ncookies - 1); if (!(pending_checkpoint= (pending_cookies *)my_malloc(size, MYF(MY_ZEROFILL)))) { @@ -8808,8 +8808,7 @@ int TC_LOG_MMAP::unlog(ulong cookie, my_xid xid) } pending_checkpoint->cookies[pending_checkpoint->count++]= cookie; - if (pending_checkpoint->count == sizeof(pending_checkpoint->cookies) / - sizeof(pending_checkpoint->cookies[0])) + if (pending_checkpoint->count == ncookies) { full_buffer= pending_checkpoint; pending_checkpoint= NULL; @@ -8843,7 +8842,7 @@ TC_LOG_MMAP::commit_checkpoint_notify(void *cookie) if (count == 0) { uint i; - for (i= 0; i < sizeof(pending->cookies)/sizeof(pending->cookies[0]); ++i) + for (i= 0; i < tc_log_page_size / sizeof(my_xid); ++i) delete_entry(pending->cookies[i]); my_free(pending); } diff --git a/sql/log.h b/sql/log.h index bda6e55e0c9..3d0413530e8 100644 --- a/sql/log.h +++ b/sql/log.h @@ -114,7 +114,6 @@ public: }; #define TC_LOG_PAGE_SIZE 8192 -#define TC_LOG_MIN_SIZE (3*TC_LOG_PAGE_SIZE) #ifdef HAVE_MMAP class TC_LOG_MMAP: public TC_LOG @@ -129,7 +128,7 @@ class TC_LOG_MMAP: public TC_LOG struct pending_cookies { uint count; uint pending_count; - ulong cookies[TC_LOG_PAGE_SIZE/sizeof(my_xid)]; + ulong cookies[1]; }; private: diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 138d542bc97..6faa52abb7a 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -7698,12 +7698,6 @@ struct my_option my_long_options[]= "more than one storage engine, when binary log is disabled).", &opt_tc_log_file, &opt_tc_log_file, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, -#ifdef HAVE_MMAP - {"log-tc-size", 0, "Size of transaction coordinator log.", - &opt_tc_log_size, &opt_tc_log_size, 0, GET_ULONG, - REQUIRED_ARG, TC_LOG_MIN_SIZE, TC_LOG_MIN_SIZE, (ulonglong) ULONG_MAX, 0, - TC_LOG_PAGE_SIZE, 0}, -#endif {"master-info-file", 0, "The location and name of the file that remembers the master and where " "the I/O replication thread is in the master's binlogs. Defaults to " diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index fe7e0135fe1..55a7cfc5a4a 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -5107,3 +5107,13 @@ static Sys_var_mybool Sys_pseudo_slave_mode( SESSION_ONLY(pseudo_slave_mode), NO_CMD_LINE, DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_pseudo_slave_mode)); +#ifdef HAVE_MMAP +static Sys_var_ulong Sys_log_tc_size( + "log_tc_size", + "Size of transaction coordinator log.", + READ_ONLY GLOBAL_VAR(opt_tc_log_size), + CMD_LINE(REQUIRED_ARG), + VALID_RANGE(my_getpagesize() * 3, ULONG_MAX), + DEFAULT(my_getpagesize() * 6), + BLOCK_SIZE(my_getpagesize())); +#endif |