Docker Community Forums

Share and learn in the Docker community.

Mysql is crashing when installing tokudb plugin with mysql data as host volume


(Nailk) #1

Expected behavior

I want to get TokuDB plugin for MySQL running on Docker for Mac.
I’ve got it successfully for following cases:

  1. on VirtualBox docker with mysql data mounted as host volume - OK
  2. on Docker for Mac without mounting any volumes - OK

Actual behavior

Mysql server is crashing inside docker when I’m trying to install tokudb plugin with mounted external volume /var/lib/mysql

I’m using Percona server 5.7 here. Also tried Percona 5.6 and MariaDB 10.1 - they also crashing with the same error.

Version: ‘5.7.11-4’ socket: ‘/var/run/mysqld/mysqld.sock’ port: 3306 Percona Server (GPL), Release ‘4’, Revision ‘5c940e1’
/mnt/workspace/percona-server-5.7-debian-binary/label_exp/debian-jessie-64bit/percona-server-5.7-5.7.11-4/storage/tokudb/PerconaFT/src/ydb.cc:230 env_fs_poller: Assertion `r == 0’ failed (errno=38)
: Function not implemented
Backtrace: (Note: toku_do_assert=0x0x7f1a3753e0b0)
/usr/lib/mysql/plugin/ha_tokudb.so(_Z19db_env_do_backtraceP8_IO_FILE+0x1b)[0x7f1a37572a8b]
/usr/lib/mysql/plugin/ha_tokudb.so(+0x138bb3)[0x7f1a37572bb3]
/usr/lib/mysql/plugin/ha_tokudb.so(+0x1040ae)[0x7f1a3753e0ae]
/usr/lib/mysql/plugin/ha_tokudb.so(+0x85979)[0x7f1a374bf979]
/usr/lib/mysql/plugin/ha_tokudb.so(+0x860a6)[0x7f1a374c00a6]
/usr/lib/mysql/plugin/ha_tokudb.so(+0x6272a)[0x7f1a3749c72a]
mysqld(_Z24ha_initialize_handlertonP13st_plugin_int+0x51)[0x7f45a1]
mysqld[0xc7c756]
mysqld[0xc81512]
mysqld(_ZN22Sql_cmd_install_plugin7executeEP3THD+0x1c)[0xc817dc]
mysqld(_Z21mysql_execute_commandP3THDb+0x1232)[0xc58362]
mysqld(_Z11mysql_parseP3THDP12Parser_state+0x5f5)[0xc5d565]
mysqld(_Z16dispatch_commandP3THDPK8COM_DATA19enum_server_command+0x904)[0xc5dee4]
mysqld(_Z10do_commandP3THD+0x1b7)[0xc5f5a7]
mysqld(handle_connection+0x2a8)[0xd21008]
mysqld(pfs_spawn_thread+0x1b4)[0xe98054]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x80a4)[0x7f1a85cea0a4]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f1a83d2b87d]
Engine status function not available
Memory usage:
Arena 0:
system bytes = 0
in use bytes = 0
Total (incl. mmap):
system bytes = 0
in use bytes = 0
max mmap regions = 0
max mmap bytes = 0
08:30:14 UTC - mysqld got signal 6 ;
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.

Information

pinata diagnose -u
OS X: version 10.11.4 (build: 15E65)
Docker.app: version v1.11.0-beta9
Running diagnostic tests:
[OK] docker-cli
[OK] Moby booted
[OK] driver.amd64-linux
[OK] vmnetd
[OK] osxfs
[OK] db
[OK] slirp
[OK] menubar
[OK] environment
[OK] Docker
[OK] VT-x
Docker logs are being collected into /tmp/20160501-114314.tar.gz
Most specific failure is: No error was detected
Your unique id is: DA99012E-552D-4A53-B97F-E23A062A9939

Steps to reproduce the behavior

  1. Create directories for volumes

mkdir -p /Users/nail/docker-volumes/mysql/data
mkdir -p /Users/nail/docker-volumes/mysql/conf
mkdir -p /Users/nail/docker-volumes/mysql/socket
mkdir -p /Users/nail/docker-volumes/mysql/initdb

  1. Create image and start the container

docker create --privileged --name wgr-mysql
-v /Users/nail/docker-volumes/mysql/data:/var/lib/mysql
-v /Users/nail/docker-volumes/mysql/conf:/etc/mysql/conf.d
-v /Users/nail/docker-volumes/mysql/socket:/var/run/mysqld
-v /Users/nail/docker-volumes/mysql/initdb:/docker-entrypoint-initdb.d
-e MYSQL_ALLOW_EMPTY_PASSWORD=yes
percona:5.7
docker start wgr-mysql

  1. Prepare tokudb installation

docker exec -t -i wgr-mysql bash
apt-get update && apt-get install percona-server-tokudb-5.7

  1. Being in container bash, install any text editor and add following lines at the beginning of /docker-entrypoint.sh:

echo never > /sys/kernel/mm/transparent_hugepage/enabled
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1

  1. Restart the container
    mysqladmin -u root shutdown
    docker start wgr-mysql

  2. Now connect to the mysql and run
    INSTALL PLUGIN tokudb SONAME ‘ha_tokudb.so’;

After that mysql server goes away.