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

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/ env_fs_poller: Assertion `r == 0’ failed (errno=38)
: Function not implemented
Backtrace: (Note: toku_do_assert=0x0x7f1a3753e0b0)
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.


pinata diagnose -u
OS X: version 10.11.4 (build: 15E65) 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
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 /

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

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

  2. Now connect to the mysql and run

After that mysql server goes away.