Bug #80818 default log-tc-size too small on POWER - 3 * ( 64K page size) minimium needed
Submitted: 22 Mar 2016 6:55 Modified: 6 Jul 2016 18:01
Reporter: Daniel Black Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: XA transactions Severity:S2 (Serious)
Version:5.7.11 OS:Linux (Power8 ppc64le)
Assigned to: CPU Architecture:ARM
Tags: power

[22 Mar 2016 6:55] Daniel Black
Description:
MariaDB duplicate that indicates that 3*PAGESIZE is sufficient however Power page size is 64K. 24K doesn't mean the 3*PAGESIZE specification.

https://jira.mariadb.org/browse/MDEV-7273

during mtr:

unit_tests                               w0 [ fail ]
..
  The following tests FAILED:
         24 - merge_large_tests (Failed)
Report from unit tests in /home/danielgb/build_mysql-5.7/mysql-test/var/ctest.log

from ctest.log
# Run 231 TCLogMMapTest.TClogCommit
06:22:45 UTC - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.

key_buffer_size=0
read_buffer_size=131072
max_used_connections=0
max_threads=151
thread_count=0
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 59996 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x1003f5b2de0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 3ffffd7a4e00 thread_stack 0x40000
/home/danielgb/build_mysql-5.7/unittest/gunit/merge_large_tests-t[0x10a629c4]
/home/danielgb/build_mysql-5.7/unittest/gunit/merge_large_tests-t[0x108690d0]
linux-vdso64.so.1(__kernel_sigtramp_rt64+0x0)[0x3fff8a640478]
/home/danielgb/build_mysql-5.7/unittest/gunit/merge_large_tests-t[0x1083134c]
/home/danielgb/build_mysql-5.7/unittest/gunit/merge_large_tests-t[0x1083123c]
/home/danielgb/build_mysql-5.7/unittest/gunit/merge_large_tests-t[0x101bbb58]
/home/danielgb/build_mysql-5.7/unittest/gunit/merge_large_tests-t[0x10f6e75c]
/home/danielgb/build_mysql-5.7/unittest/gunit/merge_large_tests-t[0x10f62fac]
/home/danielgb/build_mysql-5.7/unittest/gunit/merge_large_tests-t[0x10f634e4]
/home/danielgb/build_mysql-5.7/unittest/gunit/merge_large_tests-t[0x10f63814]
/home/danielgb/build_mysql-5.7/unittest/gunit/merge_large_tests-t[0x10f66658]
/home/danielgb/build_mysql-5.7/unittest/gunit/merge_large_tests-t[0x10f66cbc]
/home/danielgb/build_mysql-5.7/unittest/gunit/merge_large_tests-t[0x100597c0]
/opt/at9.0-3-beta1/lib64/power8/libc.so.6(+0x22e9c)[0x3fff89d22e9c]
/opt/at9.0-3-beta1/lib64/power8/libc.so.6(__libc_start_main+0xb8)[0x3fff89d23098]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0): Connection ID (thread ID): 4
Status: NOT_KILLED

with following patch the crash does not occur:

diff --git a/sql/sql_class.h b/sql/sql_class.h
index bc46199..34bcb83 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -212,7 +212,7 @@ public:
 };

-#define TC_LOG_PAGE_SIZE   8192
+#define TC_LOG_PAGE_SIZE   64*1024
 #define TC_LOG_MIN_SIZE    (3*TC_LOG_PAGE_SIZE)

(Obviously not intended to be the final patch.)

unit_tests                               w0 [ pass ]
--------------------------------------------------------------------------

Unit tests: 100% tests passed, 0 tests failed out of 27
Report from unit tests in /home/danielgb/build_mysql-5.7/mysql-test/var/ctest.log
--------------------------------------------------------------------------

How to repeat:
compile on Power hardware.

run ./mysql-test-run

Suggested fix:
TC_LOG_PAGE_SIZE to be the same as the OS page size.
[22 Mar 2016 6:59] Daniel Black
correct typo in Synopsis
[22 Mar 2016 23:49] Daniel Black
power-log-tc-size.patch

Attachment: power-log-tc-size.patch (text/x-patch), 1.09 KiB.

[29 Mar 2016 7:06] MySQL Verification Team
Hello Daniel,

Thank you for the report and contribution.

Thanks,
Umesh
[8 Jun 2016 14:54] OCA Admin
Contribution submitted via Github - Bug #80818: default log-tc-size too small on POWER - 3 * ( 64K page size) minimi 
(*) Contribution by Alexey Kopytov (Github akopytov, mysql-server/pull/80#issuecomment-224567038): I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: git_patch_72994826.txt (text/plain), 1.49 KiB.

[6 Jul 2016 18:01] Paul DuBois
Posted by developer:
 
Noted in 8.0.0 changelog.

The hardcoded memory page size of 8KB for the memory-mapped
transaction coordinator was too small for platforms such as ARM64 and
PowerPC where the page size is much larger. The server now invokes a
system call to get the page size of the current platform rather than
using a hardcoded value. A consequence for the --log-tc-size option
is that the minimum and default values are now 6 times the page size.
Also, the value must be a multiple of the page size. Thanks to Alexey
Kopytov for the patch.
[6 Oct 2017 7:46] MySQL Verification Team
Related - Bug #87995